Skip to content

Commit 17fd68d

Browse files
committed
Merge branch 'sr/gitweb-hilite-more'
* sr/gitweb-hilite-more: gitweb: remove unnecessary test when closing file descriptor gitweb: add extensions to highlight feature map
2 parents 857ba70 + 3ca7353 commit 17fd68d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

gitweb/gitweb.perl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,14 @@ sub evaluate_uri {
250250
# main extensions, defining name of syntax;
251251
# see files in /usr/share/highlight/langDefs/ directory
252252
map { $_ => $_ }
253-
qw(py c cpp rb java css php sh pl js tex bib xml awk bat ini spec tcl),
253+
qw(py c cpp rb java css php sh pl js tex bib xml awk bat ini spec tcl sql make),
254254
# alternate extensions, see /etc/highlight/filetypes.conf
255255
'h' => 'c',
256+
map { $_ => 'sh' } qw(bash zsh ksh),
256257
map { $_ => 'cpp' } qw(cxx c++ cc),
257-
map { $_ => 'php' } qw(php3 php4),
258+
map { $_ => 'php' } qw(php3 php4 php5 phps),
258259
map { $_ => 'pl' } qw(perl pm), # perhaps also 'cgi'
259-
'mak' => 'make',
260+
map { $_ => 'make'} qw(mak mk),
260261
map { $_ => 'xml' } qw(xhtml html htm),
261262
);
262263

@@ -3464,8 +3465,7 @@ sub run_highlighter {
34643465
my ($fd, $highlight, $syntax) = @_;
34653466
return $fd unless ($highlight && defined $syntax);
34663467

3467-
close $fd
3468-
or die_error(404, "Reading blob failed");
3468+
close $fd;
34693469
open $fd, quote_command(git_cmd(), "cat-file", "blob", $hash)." | ".
34703470
quote_command($highlight_bin).
34713471
" --xhtml --fragment --syntax $syntax |"

0 commit comments

Comments
 (0)