Merge branch 'cw/gitweb-hilite-config'
[gitweb.git] / gitweb / gitweb.perl
index a85e2f63197649bff4842ea2970448205618c104..e5910ce8f93cbfb92fdb2ed63c65140d9b8b39b3 100755 (executable)
@@ -165,6 +165,12 @@ sub evaluate_uri {
 # 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 => {
@@ -3360,7 +3366,8 @@ sub run_highlighter {
        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;
 }