about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-09-24 20:05:55 +0000
committerEric Wong <e@80x24.org>2019-09-26 01:54:36 +0000
commitdadaf7fd96301f1737b2eca2171a742daef8befd (patch)
tree7f99b8309065e1e11f34692a83a7ca49238a0415
parentb1d487f6024609908b9f195b2947a051615108f2 (diff)
downloadpublic-inbox-dadaf7fd96301f1737b2eca2171a742daef8befd.tar.gz
Quoting Amitai Schleier, who made this same change in ikiwiki[1],
where lots of the public-inbox highlight code comes from:

> As of 3.51, searchFile() is no longer provided in highlight's Perl
> bindings (at least on NetBSD and OS X, as built from pkgsrc). This
> leaves us falling through to getConfDir(), which has been gone
> rather longer.
>
> From highlight git, it appears searchFile() and getFiletypesConfPath()
> both originated in the 3.14 release. The latter is still available in
> 3.51, and returns the same result searchFile() used to. Switch to it.

So, this should still be compatible with the version of highlight.pm in
Debian, but add support for newer versions as well.

[1]: commit 4d06df9583e6c4145f8c6fc2fd51d7894c0b85ce

Cc: Amitai Schleier <schmonz-web-ikiwiki@schmonz.com>
-rw-r--r--lib/PublicInbox/HlMod.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/HlMod.pm b/lib/PublicInbox/HlMod.pm
index 36e31106..1d7a460d 100644
--- a/lib/PublicInbox/HlMod.pm
+++ b/lib/PublicInbox/HlMod.pm
@@ -20,7 +20,7 @@ use PublicInbox::Hval qw(src_escape ascii_html);
 my $hl;
 
 sub _parse_filetypes ($) {
-        my $ft_conf = $_[0]->searchFile('filetypes.conf') or
+        my $ft_conf = $_[0]->getFiletypesConfPath('filetypes') or
                                 die 'filetypes.conf not found by highlight';
         open my $fh, '<', $ft_conf or die "failed to open($ft_conf): $!";
         local $/;