Commit e291131d authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

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
No related merge requests found
Showing with 4 additions and 3 deletions
+4 -3
......@@ -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
......
......@@ -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 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment