nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit b8a47f4e37eafd5e3340f80f6794b8559e7943f3
parent b3b2fa8856a4ea7ff9b9bda2b78487c95141e3a6
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Sun, 20 Mar 2016 16:19:30 +0000

Not bothering to set 'answer'; just using 'last_search', which has already
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

Diffstat:
MChangeLog | 2++
Msrc/search.c | 6+-----
2 files changed, 3 insertions(+), 5 deletions(-)

diff --git 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, diff --git a/src/search.c b/src/search.c @@ -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. */