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
* 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
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 {