diff --git a/ChangeLog b/ChangeLog index 0c0c01a7..8df3898d 100644 --- 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 * src/search.c (search_init): Always remember the last typed string, diff --git a/src/search.c b/src/search.c index e7334396..32b00e99 100644 --- 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. */