Snipping an always-FALSE condition -- do_prompt() will always

return with -2 when answer is empty, so when answer is empty
i cannot be zero.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5747 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg 2016-03-19 18:23:37 +00:00
parent fc1edf28ce
commit e291131d0a
2 changed files with 4 additions and 3 deletions

View File

@ -6,6 +6,7 @@
* src/browser.c (do_browser): Delete a snippet of dead code.
* src/browser.c (do_browser): Delete an unneeded variable.
* src/search.c (do_gotolinecolumn): Delete another unneeded variable.
* src/search.c (search_init): Snip an always-FALSE condition.
2016-03-17 Benno Schulenberg <bensberg@justemail.net>
* src/search.c (do_research): Use the Search key bindings also during

View File

@ -192,9 +192,9 @@ int search_init(bool replacing, bool use_answer)
free(backupstring);
backupstring = NULL;
/* Cancel any search, or just return with no previous search. */
if (i == -1 || (i < 0 && *last_search == '\0') ||
(!replacing && i == 0 && *answer == '\0')) {
/* If the search was cancelled, or we have a blank answer and
* nothing was searched for yet during this session, get out. */
if (i == -1 || (i == -2 && *last_search == '\0')) {
statusbar(_("Cancelled"));
return -1;
} else {