commit a966d991e68ddc2a2c7274142ad1ee8c0f1b7f91
parent 635fae3ed02eeebc4a4496e40b0c986a887bcc2c
Author: Adam Rogoyski <rogoyski@cs.utexas.edu>
Date: Sun, 9 Jul 2000 18:42:53 +0000
- findnextstr() off by one with past_editbot.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@97 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/search.c b/search.c
@@ -136,11 +136,11 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle)
/* Look for searchstr until EOF */
while (fileptr != NULL &&
(found = strstrwrapper(searchstr, needle)) == NULL) {
- if (!past_editbot && (fileptr == editbot))
- past_editbot = 1;
fileptr = fileptr->next;
+ if (!past_editbot && (fileptr == editbot))
+ past_editbot = 1;
if (fileptr == begin)
return NULL;
@@ -179,8 +179,7 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle)
for (tmp = fileptr->data; tmp != found; tmp++)
current_x++;
- if (past_editbot)
- edit_update(current);
+ edit_update(current);
reset_cursor();
if (!quiet)