aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki/Plugin/highlight.pm14
1 files changed, 11 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/highlight.pm b/IkiWiki/Plugin/highlight.pm
index fbe7ddff4..0aa7386ba 100644
--- a/IkiWiki/Plugin/highlight.pm
+++ b/IkiWiki/Plugin/highlight.pm
@@ -60,9 +60,17 @@ sub checkconfig () {
}
if (! exists $config{filetypes_conf}) {
- $config{filetypes_conf}=
- ($data_dir ? $data_dir->getConfDir() : "/etc/highlight/")
- . "filetypes.conf";
+ if (! $data_dir ) {
+ $config{filetypes_conf}= "/etc/highlight/filetypes.conf";
+ } elsif ( $data_dir -> can('searchFile') ) {
+ # 3.18 +
+ $config{filetypes_conf}=
+ $data_dir -> searchFile("filetypes.conf");
+ } else {
+ # 3.9 +
+ $config{filetypes_conf}=
+ $data_dir -> getConfDir() . "/filetypes.conf";
+ }
}
if (! exists $config{langdefdir}) {
$config{langdefdir}=