[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
LYNX-DEV TEXTAREA element handling
From: |
Natarajan Krishnaswami |
Subject: |
LYNX-DEV TEXTAREA element handling |
Date: |
Sat, 21 Mar 1998 16:14:36 -0500 |
Greetings,
I noticed a problem with the handling of newlines in a TEXTAREA
element in lynx 2.8.1dev2: all of the trailing and preceding newlines
are removed [src/HTML.c, lines 6348-6360]. I seem to recall reading
that only the (one of each) preceding and the trailing newlines should
be ignored here, and parsing a sample HTML document with nsgmls seems
to confirm this. A patch follows:
--- src/HTML.c.orig Sat Mar 21 15:29:48 1998
+++ src/HTML.c Sat Mar 21 15:30:35 1998
@@ -6346,15 +6346,15 @@
me->UsePlainSpace,
me->HiddenValue);
/*
- * Trim any trailing newlines and
- * skip any lead newlines. - FM
+ * Trim a leading newline and
+ * skip a trailing newline, if present. - NK
*/
if (*data != '\0') {
cp = (data + strlen(data)) - 1;
- while (cp >= data && *cp == '\n') {
+ if (cp >= data && *cp == '\n') {
*cp-- = '\0';
}
- while (*data == '\n') {
+ if (*data == '\n') {
data++;
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- LYNX-DEV TEXTAREA element handling,
Natarajan Krishnaswami <=