Skip to content

Commit

Permalink
Merge branch 'rh/maint-gitweb-highlight-ext'
Browse files Browse the repository at this point in the history
Fixes a clever misuse of perl's list interpretation.

* rh/maint-gitweb-highlight-ext:
  gitweb.perl: fix %highlight_ext mappings
  • Loading branch information
gitster committed Nov 20, 2012
2 parents 077ad4a + 048b399 commit 05849c4
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions gitweb/gitweb.perl
Expand Up @@ -270,16 +270,15 @@ sub evaluate_uri {
our %highlight_ext = (
# main extensions, defining name of syntax;
# see files in /usr/share/highlight/langDefs/ directory
map { $_ => $_ }
qw(py c cpp rb java css php sh pl js tex bib xml awk bat ini spec tcl sql make),
(map { $_ => $_ } qw(py rb java css js tex bib xml awk bat ini spec tcl sql)),
# alternate extensions, see /etc/highlight/filetypes.conf
'h' => 'c',
map { $_ => 'sh' } qw(bash zsh ksh),
map { $_ => 'cpp' } qw(cxx c++ cc),
map { $_ => 'php' } qw(php3 php4 php5 phps),
map { $_ => 'pl' } qw(perl pm), # perhaps also 'cgi'
map { $_ => 'make'} qw(mak mk),
map { $_ => 'xml' } qw(xhtml html htm),
(map { $_ => 'c' } qw(c h)),
(map { $_ => 'sh' } qw(sh bash zsh ksh)),
(map { $_ => 'cpp' } qw(cpp cxx c++ cc)),
(map { $_ => 'php' } qw(php php3 php4 php5 phps)),
(map { $_ => 'pl' } qw(pl perl pm)), # perhaps also 'cgi'
(map { $_ => 'make'} qw(make mak mk)),
(map { $_ => 'xml' } qw(xml xhtml html htm)),
);

# You define site-wide feature defaults here; override them with
Expand Down

0 comments on commit 05849c4

Please sign in to comment.