git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* gitweb showing slash r at the end of line
@ 2012-01-27 14:19 Ondra Medek
  2012-01-27 21:35 ` Jakub Narebski
  0 siblings, 1 reply; 8+ messages in thread
From: Ondra Medek @ 2012-01-27 14:19 UTC (permalink / raw)
  To: git

Hi,
we have gitweb running on Linux box. Some files have Windows line ending
(CRLF) end we do not use core.autcrlf translation. gitweb show the last \r
in the end of each line, which is annoying. I have creates a simple patch to
avoid this. It adds just one line. I am not sure if the regexp should
contain 'g' switch in the end. Also, not sure if there shoul be some config
option to switch on/off this?

Cheers
Ondra
---
 gitweb/gitweb.perl |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index abb5a79..92175bc 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1500,6 +1500,7 @@ sub esc_html {
        if ($opts{'-nbsp'}) {
                $str =~ s/ / /g;
        }
+       $str =~ s/\r$//;
        $str =~ s|([[:cntrl:]])|(($1 ne "\t") ? quot_cec($1) : $1)|eg;
        return $str;
 }
--
1.7.8.4


--
View this message in context: http://git.661346.n2.nabble.com/gitweb-showing-slash-r-at-the-end-of-line-tp7229895p7229895.html
Sent from the git mailing list archive at Nabble.com.

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-02-02 20:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-27 14:19 gitweb showing slash r at the end of line Ondra Medek
2012-01-27 21:35 ` Jakub Narebski
2012-01-27 23:15   ` Junio C Hamano
2012-01-28 17:02     ` Jakub Narebski
2012-01-30  7:55       ` Ondra Medek
2012-01-30  9:23         ` Jakub Narebski
2012-01-30 16:09           ` Ondra Medek
2012-02-02 20:04             ` Jakub Narebski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).