diff --git a/ChangeLog b/ChangeLog index 0e85cc40..a5781802 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2016-03-17 Benno Schulenberg * src/search.c (do_research): Use the Search key bindings also during a Re-search, to enable cancelling. This fixes Savannah bug #47159. + * src/search.c (do_replace): Remove two redundant returns. 2016-03-14 Benno Schulenberg * src/color.c (color_update): Don't dereference a possible NULL. diff --git a/src/search.c b/src/search.c index 38c0bceb..dd85fe44 100644 --- a/src/search.c +++ b/src/search.c @@ -424,15 +424,12 @@ void do_search(void) i = search_init(FALSE, FALSE); - if (i == -1) - /* Cancel, Go to Line, blank search string, or regcomp() failed. */ + if (i == -1) /* Cancelled, or some other exit reason. */ search_replace_abort(); - else if (i == -2) - /* Replace. */ + else if (i == -2) /* Do a replace instead. */ do_replace(); #if !defined(NANO_TINY) || defined(HAVE_REGEX_H) - else if (i == 1) - /* Case Sensitive, Backwards, or Regexp search toggle. */ + else if (i == 1) /* Toggled something. */ do_search(); #endif @@ -848,16 +845,12 @@ void do_replace(void) } i = search_init(TRUE, FALSE); - if (i == -1) { - /* Cancel, Go to Line, blank search string, or regcomp() failed. */ + + if (i == -1) /* Cancelled, or some other exit reason. */ search_replace_abort(); - return; - } else if (i == -2) { - /* No Replace. */ + else if (i == -2) /* Do a search instead. */ do_search(); - return; - } else if (i == 1) - /* Case Sensitive, Backwards, or Regexp search toggle. */ + else if (i == 1) /* Toggled something. */ do_replace(); if (i != 0)