git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: [PATCH] git-gui: Remove space from the end of aspell's reply before processing
Date: Tue, 30 Sep 2008 08:39:29 +0200	[thread overview]
Message-ID: <48E1C9A1.2090409@viscovery.net> (raw)

From: Johannes Sixt <johannes.sixt@telecom.at>

When git gui processes a reply from aspell it explicitly ignores an empty
line. The Windows version of aspell, however, terminates lines with CRLF,
but TCL's 'gets' does not remove CR, hence, a "visibly" empty line was not
actually recognized as empty. With this change we explicitly trim off
whitespace before the line is further processed.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---
 There's probably a better solution by having TCL do the translation of
 line endings, but I don't know how to do that.

 -- Hannes

 lib/spellcheck.tcl |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/spellcheck.tcl b/lib/spellcheck.tcl
index a479b2f..e612030 100644
--- a/lib/spellcheck.tcl
+++ b/lib/spellcheck.tcl
@@ -314,6 +314,7 @@ method _run {} {
 method _read {} {
 	while {[gets $s_fd line] >= 0} {
 		set lineno [lindex $s_pending 0 0]
+		set line [string trim $line]

 		if {$s_clear} {
 			$w_text tag remove misspelled "$lineno.0" "$lineno.end"
-- 
1.6.0.2.1262.ge466e

                 reply	other threads:[~2008-09-30  6:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=48E1C9A1.2090409@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=git@vger.kernel.org \
    --cc=spearce@spearce.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).