Commit 63287926 authored by Chris Allegretta's avatar Chris Allegretta
Browse files

Fix search/replace history adding blank lines, yuck

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1335 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 5 additions and 3 deletions
+5 -3
...@@ -453,7 +453,8 @@ int do_search(void) ...@@ -453,7 +453,8 @@ int do_search(void)
#ifndef NANO_SMALL #ifndef NANO_SMALL
/* add this search string to the search history list */ /* add this search string to the search history list */
update_history(&search_history, answer); if (strcmp(answer, ""))
update_history(&search_history, answer);
#endif /* !NANO_SMALL */ #endif /* !NANO_SMALL */
search_last_line = 0; search_last_line = 0;
...@@ -739,7 +740,8 @@ int do_replace(void) ...@@ -739,7 +740,8 @@ int do_replace(void)
} }
#ifndef NANO_SMALL #ifndef NANO_SMALL
update_history(&search_history, answer); if (strcmp(answer, ""))
update_history(&search_history, answer);
#endif /* !NANO_SMALL */ #endif /* !NANO_SMALL */
/* Again, there was a previous string, but they deleted it and hit enter */ /* Again, there was a previous string, but they deleted it and hit enter */
...@@ -788,7 +790,7 @@ int do_replace(void) ...@@ -788,7 +790,7 @@ int do_replace(void)
_("Replace with")); _("Replace with"));
} }
#ifndef NANO_SMALL #ifndef NANO_SMALL
if (i == 0) if (i == 0 && strcmp(answer, ""))
update_history(&replace_history, answer); update_history(&replace_history, answer);
#endif /* !NANO_SMALL */ #endif /* !NANO_SMALL */
......
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