# ------------------------------------------------------------------------------
# CHANGES        |   24 +++++++++++++++++++++++
# configure      |    2 -
# configure.in   |    4 ---
# src/GridText.c |   56 ++++++++++++++++++++++++-------------------------------
# src/GridText.h |    4 ---
# src/LYCurses.c |    2 -
# src/LYMain.c   |    8 ++++++-
# 7 files changed, 59 insertions(+), 41 deletions(-)
# ------------------------------------------------------------------------------
Index: CHANGES
--- lynx2.8.4rel.1a/CHANGES	Mon Jul 23 21:43:12 2001
+++ lynx2.8.4rel.1b/CHANGES	Sat Oct  6 16:05:42 2001
@@ -1,6 +1,30 @@
 Changes since Lynx 2.8 release
 ===============================================================================
 
+extracted from 2001-10-06 (2.8.5dev.3)
+* modify LYtouchline() to avoid using wredrawln() for ncurses, since the
+  LYwin variable may be a pad much wider than the screen, which is not handled
+  properly (report by Karl Eichwalder <keichwa@gmx.net>) -TD
+* correct beginning configure script, which was supposed to remove
+  config.cache, but did not, due to a misplaced line when it was added
+  1998-06-04 (prompted by a report by Fr3dY <fr3dy@retemail.es> that the
+  checks for srand/rand did not work) -TD
+
+extracted from 2001-08-15 (2.8.5dev.2)
+* work around defect in move_anchors_in_region() and related logic by changing
+  default for nested-tables to FALSE when Lynx is not configured for
+  color-style.  The problem is that when an anchor is shifted right by
+  nested-table logic, if it has a <BR> near the beginning of a table cell and
+  it happens to be split across a line, its size will not be adjusted properly
+  (report by Hataguchi Takeshi) -TD
+* correct logic used for trimming TEXTAREA introduced in 2.8.4pre.3, which did
+  not trim carriage-return characters if TRIM_INPUT_FIELDS was false.
+  (report by Hataguchi Takeshi <patakuti@t3.rim.or.jp>) -TD
+* correct a bug in search logic which happens with pages shorter than the
+  screen, due to improper starting-line value sent to search function.  Fixed
+  by adding checks in www_search_backward() and www_search_foreward(), (report
+  by -Frederic L W Meunier) -TD
+
 extracted from 2001-07-24 (2.8.5dev.1)
 * modify GetChar() definition for PDCurses to ignore key-modifiers which are
   passed back from getch() as if they were key codes.  Those interfere with
Index: configure
--- lynx2.8.4rel.1a/configure	Mon Jul 23 20:55:50 2001
+++ lynx2.8.4rel.1b/configure	Sat Oct  6 16:05:26 2001
@@ -613,8 +613,8 @@
 fi
 
 
+cat config.cache; rm -f config.cache; touch config.cache
 CONFIG_H=lynx_cfg.h
-
 
 ac_aux_dir=
 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
Index: configure.in
--- lynx2.8.4rel.1a/configure.in	Mon Jul 23 20:55:50 2001
+++ lynx2.8.4rel.1b/configure.in	Sat Oct  6 16:05:26 2001
@@ -4,12 +4,10 @@
 dnl and Jim Spath <jspath@mail.bcpl.lib.md.us>
 
 AC_PREREQ(2.12.971222)
-rm -f config.cache
-
 AC_INIT(userdefs.h)
+rm -f config.cache; touch config.cache
 CONFIG_H=lynx_cfg.h
 AC_CONFIG_HEADER($CONFIG_H:config.hin)
-
 CF_CHECK_CACHE
 
 PACKAGE=lynx
Index: src/GridText.c
--- lynx2.8.4rel.1a/src/GridText.c	Tue Jul 10 15:48:01 2001
+++ lynx2.8.4rel.1b/src/GridText.c	Sat Oct  6 15:29:29 2001
@@ -75,6 +75,11 @@
 #define FirstHTLine(text) ((text)->last_line->next)
 #define LastHTLine(text)  ((text)->last_line)
 
+PRIVATE void HText_trimHightext PARAMS((
+	HText *		text,
+	BOOLEAN		final,
+	int		stop_before));
+
 #ifdef USE_COLOR_STYLE
 PRIVATE void LynxResetScreenCache NOARGS
 {
@@ -5257,7 +5262,7 @@
 	if (a->show_anchor == NO) {
 	    /*
 	     *  The anchor's content is restricted to white
-	     *  and special characters, so set it's number
+	     *  and special characters, so set its number
 	     *  and extent to zero, decrement the visible
 	     *  anchor number counter, and add this anchor
 	     *  to the hidden links list. - FM
@@ -5272,7 +5277,7 @@
 	    /*
 	     *  The anchor's content is not restricted to white
 	     *  and special characters, so we'll display the
-	     *  content, but shorten it's extent by any trailing
+	     *  content, but shorten its extent by any trailing
 	     *  blank lines we've detected. - FM
 	     */
 	    a->extent -= ((BlankExtent < a->extent) ?
@@ -5455,7 +5460,7 @@
 **  This needs to be done so that display_page finds the anchors in the
 **  form it expects when it sets the links[] elements.
 */
-PUBLIC void HText_trimHightext ARGS3(
+PRIVATE void HText_trimHightext ARGS3(
 	HText *,	text,
 	BOOLEAN,	final,
 	int,		stop_before)
@@ -5677,15 +5682,6 @@
 }
 
 
-/*	Dump diagnostics to tfp
-*/
-PUBLIC void HText_dump ARGS1(
-	HText *,	text GCC_UNUSED)
-{
-    CTRACE((tfp, "HText: Dump called\n"));
-}
-
-
 /*	Return the anchor associated with this node
 */
 PUBLIC HTParentAnchor * HText_nodeAnchor ARGS1(
@@ -6328,7 +6324,7 @@
  *  for the first hit with the string indicated by target.  If
  *  there is no hit, FALSE is returned.  If there is a hit, then
  *  a copy of the line starting at that first hit is loaded into
- *  *data with all IsSpecial characters stripped, it's offset and
+ *  *data with all IsSpecial characters stripped, its offset and
  *  the printable target length (without IsSpecial, or extra CJK
  *  or utf8 characters) are loaded into *offset and *tLen, and
  *  TRUE is returned. - FM
@@ -7736,7 +7732,7 @@
 	HTLine *,	line,
 	int,		count)
 {
-    BOOL wrapped = FALSE;
+    int wrapped = 0;
     TextAnchor *a = line_num_to_anchor(count - 1);
     int tentative_result = -1;
 
@@ -7756,12 +7752,12 @@
 	if (LYno_attr_strstr(line->data, target)) {
 	    tentative_result = count;
 	    break;
-	} else if (count == start_line && wrapped) {
+	} else if ((count == start_line && wrapped) || wrapped > 1) {
 	    HTUserMsg2(STRING_NOT_FOUND, target);
 	    return -1;
 	} else if (line == HTMainText->last_line) {
 	    count = 0;
-	    wrapped = TRUE;
+	    wrapped++;
 	}
 	line = line->next;
 	count++;
@@ -7779,7 +7775,7 @@
 	HTLine *,	line,
 	int,		count)
 {
-    BOOL wrapped = FALSE;
+    int wrapped = 0;
     TextAnchor *a = line_num_to_anchor(count - 1);
     int tentative_result = -1;
 
@@ -7799,12 +7795,12 @@
 	if (LYno_attr_strstr(line->data, target)) {
 	    tentative_result = count;
 	    break;
-	} else if (count == start_line && wrapped) {
+	} else if ((count == start_line && wrapped) || wrapped > 1) {
 	    HTUserMsg2(STRING_NOT_FOUND, target);
 	    return -1;
 	} else if (line == FirstHTLine(HTMainText)) {
 	    count = line_num_in_text(HTMainText, LastHTLine(HTMainText)) + 1;
-	    wrapped = TRUE;
+	    wrapped++;
 	}
 	line = line->prev;
 	count--;
@@ -11275,6 +11271,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 +11299,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 +12053,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
Index: src/GridText.h
--- lynx2.8.4rel.1a/src/GridText.h	Sat Jul  7 21:41:23 2001
+++ lynx2.8.4rel.1b/src/GridText.h	Sat Oct  6 15:29:29 2001
@@ -207,10 +207,6 @@
 	HText *		text,
 	BOOL		underline,
 	InputFieldData *I));
-extern void HText_trimHightext PARAMS((
-	HText *		text,
-	BOOLEAN		final,
-	int		stop_before));
 extern int HText_SubmitForm PARAMS((
 	FormInfo *	submit_item,
 	document *	doc,
Index: src/LYCurses.c
--- lynx2.8.4rel.1a/src/LYCurses.c	Mon Jul 23 20:55:50 2001
+++ lynx2.8.4rel.1b/src/LYCurses.c	Sat Oct  6 16:05:26 2001
@@ -1593,7 +1593,7 @@
 PUBLIC void LYtouchline ARGS1(
 	int,		row)
 {
-#if defined(HAVE_WREDRAWLN)
+#if defined(HAVE_WREDRAWLN) && !defined(NCURSES_VERSION)
     wredrawln(LYwin, row, 1);
 #else
 #if defined(HAVE_TOUCHLINE)
Index: src/LYMain.c
--- lynx2.8.4rel.1a/src/LYMain.c	Sat Jul  7 21:41:23 2001
+++ lynx2.8.4rel.1b/src/LYMain.c	Sat Oct  6 15:29:29 2001
@@ -442,7 +442,13 @@
 #endif /* EXP_PERSISTENT_COOKIES */
 
 #ifdef EXP_NESTED_TABLES
-PUBLIC BOOLEAN nested_tables = TRUE;
+PUBLIC BOOLEAN nested_tables =
+#if defined(USE_COLOR_STYLE)
+    TRUE
+#else
+    FALSE				/* see 2001-08-15  */
+#endif
+    ;
 #endif
 
 PUBLIC BOOLEAN LYShowTransferRate = TRUE;
