commit e6958d517daded25d1252682eb0d1777f59df254
parent 27ad0cdb37782ba9bf384aee397c046e16f33ad0
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Thu, 23 Mar 2006 21:25:04 +0000
cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3313 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/search.c b/src/search.c
@@ -276,25 +276,25 @@ bool findnextstr(
bool no_sameline, const filestruct *begin, size_t begin_x, const
char *needle, size_t *needle_len)
{
- filestruct *fileptr = openfile->current;
- const char *rev_start = NULL, *found = NULL;
size_t found_len;
/* The length of the match we find. */
size_t current_x_find = 0;
/* The location in the current line of the match we find. */
ssize_t current_y_find = openfile->current_y;
+ filestruct *fileptr = openfile->current;
+ const char *rev_start = fileptr->data, *found = NULL;
/* rev_start might end up 1 character before the start or after the
* end of the line. This won't be a problem because strstrwrapper()
* will return immediately and say that no match was found, and
* rev_start will be properly set when the search continues on the
* previous or next line. */
- rev_start =
+ rev_start +=
#ifndef NANO_TINY
ISSET(BACKWARDS_SEARCH) ?
- fileptr->data + (openfile->current_x - 1) :
+ openfile->current_x - 1 :
#endif
- fileptr->data + (openfile->current_x + 1);
+ openfile->current_x + 1;
/* Look for needle in the current line we're searching. */
while (TRUE) {
@@ -346,6 +346,7 @@ bool findnextstr(
return FALSE;
}
+ /* Move to the previous or next line in the file. */
#ifndef NANO_TINY
if (ISSET(BACKWARDS_SEARCH)) {
fileptr = fileptr->prev;