- findnextstr() off by one with past_editbot.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@97 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Adam Rogoyski 2000-07-09 18:42:53 +00:00
parent 635fae3ed0
commit a966d991e6
1 changed files with 3 additions and 4 deletions

View File

@ -136,11 +136,11 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle)
/* Look for searchstr until EOF */ /* Look for searchstr until EOF */
while (fileptr != NULL && while (fileptr != NULL &&
(found = strstrwrapper(searchstr, needle)) == NULL) { (found = strstrwrapper(searchstr, needle)) == NULL) {
if (!past_editbot && (fileptr == editbot))
past_editbot = 1;
fileptr = fileptr->next; fileptr = fileptr->next;
if (!past_editbot && (fileptr == editbot))
past_editbot = 1;
if (fileptr == begin) if (fileptr == begin)
return NULL; return NULL;
@ -179,8 +179,7 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle)
for (tmp = fileptr->data; tmp != found; tmp++) for (tmp = fileptr->data; tmp != found; tmp++)
current_x++; current_x++;
if (past_editbot) edit_update(current);
edit_update(current);
reset_cursor(); reset_cursor();
if (!quiet) if (!quiet)