lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev some problems in 2-8-4rel.1


From: Thomas Dickey
Subject: Re: lynx-dev some problems in 2-8-4rel.1
Date: Wed, 8 Aug 2001 18:52:48 -0400
User-agent: Mutt/1.2.5i

On Tue, Aug 07, 2001 at 09:38:36AM +0900, Hataguchi Takeshi wrote:
 
> No. I think it's CRLF vs. LF problem.  I saw this problem when I use
> Notepad.exe as a external editor (return code is CRLF) with D.C.S is
> "Western (ISO-8859-1)".

here's a fix.

--- GridText.c.orig     Tue Jul 10 15:48:01 2001
+++ GridText.c  Wed Aug  8 18:51:09 2001
@@ -11275,6 +11275,8 @@
     return(FALSE);
 }
 
+#define CanTrimTextArea(c) \
+    (LYtrimInputFields ? isspace(c) : ((c) == '\r' || (c) == '\n'))
 
 /*
  *  Cleanup new lines coming into a TEXTAREA from an external editor, or a
@@ -11301,13 +11303,11 @@
     /*
      *  Whack off trailing whitespace from the line.
      */
-    if (LYtrimInputFields) {
-       for (i = len, p = line + (len - 1); i != 0; p--, i--) {
-           if (isspace(UCH(*p)))
-               *p = '\0';
-           else
-               break;
-       }
+    for (i = len, p = line + (len - 1); i != 0; p--, i--) {
+       if (CanTrimTextArea(UCH(*p)))
+           *p = '\0';
+       else
+           break;
     }
 
     if (strlen (line) != 0) {
@@ -12057,11 +12057,9 @@
     /*
      * Nuke any blank lines from the end of the edited data.
      */
-    if (LYtrimInputFields) {
-       while ((size != 0)
-        && (isspace(UCH(ebuf[size-1])) || (ebuf[size-1] == '\0')))
-           ebuf[--size] = '\0';
-    }
+    while ((size != 0)
+     && (CanTrimTextArea(UCH(ebuf[size-1])) || (ebuf[size-1] == '\0')))
+       ebuf[--size] = '\0';
 
     /*
      * Copy each line from the temp file into the corresponding anchor

-- 
Thomas E. Dickey <address@hidden>
http://dickey.his.com
ftp://dickey.his.com

; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]