]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
Enable highlight executable path as a configuration option
[Gitweb] / gitweb.perl
index b6f6236635f8ec54e4668969c0733860eb5a72dd3fb1095585114639c20c51e6..e6bbf787cbe59937decd6cf8dcaddbd73316cd58980830a13b8c805c1c91fd97 100755 (executable)
@@ -166,6 +166,12 @@ our @diff_opts = ('-M'); # taken from git_commit
 # the gitweb domain.
 our $prevent_xss = 0;
 
 # the gitweb domain.
 our $prevent_xss = 0;
 
+# Path to the highlight executable to use (must be the one from
+# http://www.andre-simon.de due to assumptions about parameters and output).
+# Useful if highlight is not installed on your webserver's PATH.
+# [Default: highlight]
+our $highlight_bin = "++HIGHLIGHT_BIN++";
+
 # information about snapshot formats that gitweb is capable of serving
 our %known_snapshot_formats = (
        # name => {
 # information about snapshot formats that gitweb is capable of serving
 our %known_snapshot_formats = (
        # name => {
@@ -3361,7 +3367,8 @@ sub run_highlighter {
        close $fd
                or die_error(404, "Reading blob failed");
        open $fd, quote_command(git_cmd(), "cat-file", "blob", $hash)." | ".
        close $fd
                or die_error(404, "Reading blob failed");
        open $fd, quote_command(git_cmd(), "cat-file", "blob", $hash)." | ".
-                 "highlight --xhtml --fragment --syntax $syntax |"
+                 quote_command($highlight_bin).
+                 " --xhtml --fragment --syntax $syntax |"
                or die_error(500, "Couldn't open file or run syntax highlighter");
        return $fd;
 }
                or die_error(500, "Couldn't open file or run syntax highlighter");
        return $fd;
 }
This page took 0.197518 seconds and 4 git commands to generate.