git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ondra Medek <xmedeko@gmail.com>
To: git@vger.kernel.org
Subject: gitweb showing slash r at the end of line
Date: Fri, 27 Jan 2012 06:19:14 -0800 (PST)	[thread overview]
Message-ID: <1327673954458-7229895.post@n2.nabble.com> (raw)

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/ /&nbsp;/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.

             reply	other threads:[~2012-01-27 14:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-27 14:19 Ondra Medek [this message]
2012-01-27 21:35 ` gitweb showing slash r at the end of line 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1327673954458-7229895.post@n2.nabble.com \
    --to=xmedeko@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).