Merge branch 'os/gitweb-highlight-uncaptured' into maint
authorJunio C Hamano <gitster@pobox.com>
Sat, 12 Jan 2013 00:48:30 +0000 (16:48 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sat, 12 Jan 2013 00:48:30 +0000 (16:48 -0800)
"gitweb", when sorting by age to show repositories with new
activities first, used to sort repositories with absolutely nothing
in it early, which was not very useful.

* os/gitweb-highlight-uncaptured:
gitweb: fix error in sanitize when highlight is enabled

gitweb/gitweb.perl
index 656b324fb7f82c7f65c71075f57e909843c50cce..c6bafe6ead815ece2e820d303e442270749c5c4b 100755 (executable)
@@ -1556,7 +1556,7 @@ sub sanitize {
        return undef unless defined $str;
 
        $str = to_utf8($str);
-       $str =~ s|([[:cntrl:]])|($1 =~ /[\t\n\r]/ ? $1 : quot_cec($1))|eg;
+       $str =~ s|([[:cntrl:]])|(index("\t\n\r", $1) != -1 ? $1 : quot_cec($1))|eg;
        return $str;
 }