lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev Re: Lynx or ncurses bug ?


From: Thomas Dickey
Subject: Re: lynx-dev Re: Lynx or ncurses bug ?
Date: Sun, 5 Aug 2001 17:16:03 -0400
User-agent: Mutt/1.2.5i

On Sun, Aug 05, 2001 at 03:02:59PM -0300, Frédéric L. W. Meunier wrote:
> On Sun, Jul 05, 2001, at 13:34:15 -0400 Thomas E. Dickey wrote:
> 
> > I assumed that, from the trace (though I don't understand the
> > succeeding part of the trace which saved the cookies and
> > exited).
> 
> They're after I use ^C.
> 
> > I'm running 2.8.4rel.1 w/o problem (and don't recall any
> > changes to search after the one you reported). But -
> > checking, I do see this on a _short_ file.  So I guess the
> > length of the file is the aspect that breaks it.
> 
> Yes, after a few tests the length seems to be the reason.
> Anyway, I'll try to reproduce with other files, because I
> think the first time it locked I was browsing something not
> that short (and not a local file).

The problem is that the start_line parameter is given a value that's outside
the actual number of lines in the file, when the file is shorter than the
screen.  My rewrite of the search code missed that case.  Here's a fix.

--- GridText.c.orig     Tue Jul 10 15:48:01 2001
+++ GridText.c  Sun Aug  5 16:53:03 2001
@@ -7736,7 +7736,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 +7756,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 +7779,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 +7799,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--;
-- 
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]