]> git.wh0rd.org Git - nano.git/commitdiff
Not bothering to set 'answer'; just using 'last_search', which has already
authorBenno Schulenberg <bensberg@justemail.net>
Sun, 20 Mar 2016 16:19:30 +0000 (16:19 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Sun, 20 Mar 2016 16:19:30 +0000 (16:19 +0000)
been set to 'answer' in search_init() when 'answer' isn't empty, and when
'answer' /is/ empty we use 'last_search' anyway.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5755 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/search.c

index 0c0c01a70316ed80e891256153e14f444ad09b2c..8df3898d1392087a6c2844239caa7352bf098ccd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,8 @@
        * src/files.c (do_writeout): When the name of the file was changed,
        always ask whether this is okay.  This fixes Savannah bug #46894.
        * src/search.c (do_research): Use 'return' instead of 'else'.
+       * src/search.c (do_search): Don't bother setting 'answer'; just use
+       'last_search', which has been set to 'answer' in search_init().
 
 2016-03-19  Benno Schulenberg  <bensberg@justemail.net>
        * src/search.c (search_init): Always remember the last typed string,
index e7334396fd3409683beac729fd402c4ec91219c1..32b00e996c5f0040630ab9c1516d74f1af9359ab 100644 (file)
@@ -434,16 +434,12 @@ void do_search(void)
     if (i != 0)
        return;
 
-    /* If answer is empty, use what was last searched for. */
-    if (*answer == '\0')
-       answer = mallocstrcpy(answer, last_search);
-
     findnextstr_wrap_reset();
     didfind = findnextstr(
 #ifndef DISABLE_SPELLER
        FALSE,
 #endif
-       openfile->current, openfile->current_x, answer, NULL);
+       openfile->current, openfile->current_x, last_search, NULL);
 
     /* If we found something, and we're back at the exact same spot where
      * we started searching, then this is the only occurrence. */