]> git.wh0rd.org Git - nano.git/commitdiff
Using a 'return' instead of an 'else'.
authorBenno Schulenberg <bensberg@justemail.net>
Sun, 20 Mar 2016 16:03:20 +0000 (16:03 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Sun, 20 Mar 2016 16:03:20 +0000 (16:03 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5754 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/search.c

index d4864319ed5c091d5b6709c5f13a075a5b97d422..0c0c01a70316ed80e891256153e14f444ad09b2c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,7 @@
        the items from newest to oldest.  This fixes Savannah bug #47205.
        * src/files.c (do_writeout): When the name of the file was changed,
        always ask whether this is okay.  This fixes Savannah bug #46894.
+       * src/search.c (do_research): Use 'return' instead of 'else'.
 
 2016-03-19  Benno Schulenberg  <bensberg@justemail.net>
        * src/search.c (search_init): Always remember the last typed string,
index 9700ebe4d9b2bb526e6935781296156615fca100..e7334396fd3409683beac729fd402c4ec91219c1 100644 (file)
@@ -499,31 +499,31 @@ void do_research(void)
        last_search = mallocstrcpy(last_search, searchbot->prev->data);
 #endif
 
-    if (last_search[0] == '\0')
+    if (last_search[0] == '\0') {
        statusbar(_("No current search pattern"));
-    else {
+       return;
+    }
+
 #ifdef HAVE_REGEX_H
-       /* Since answer is "", use last_search! */
-       if (ISSET(USE_REGEXP) && !regexp_init(last_search))
-           return;
+    if (ISSET(USE_REGEXP) && !regexp_init(last_search))
+       return;
 #endif
 
-       /* Use the search-menu key bindings, to allow cancelling. */
-       currmenu = MWHEREIS;
+    /* Use the search-menu key bindings, to allow cancelling. */
+    currmenu = MWHEREIS;
 
-       findnextstr_wrap_reset();
-       didfind = findnextstr(
+    findnextstr_wrap_reset();
+    didfind = findnextstr(
 #ifndef DISABLE_SPELLER
                FALSE,
 #endif
                openfile->current, openfile->current_x, last_search, NULL);
 
-       /* If we found something, and we're back at the exact same spot
-        * where we started searching, then this is the only occurrence. */
-       if (didfind && fileptr == openfile->current &&
-               fileptr_x == openfile->current_x && didfind)
-           statusbar(_("This is the only occurrence"));
-    }
+    /* If we found something, and we're back at the exact same spot
+     * where we started searching, then this is the only occurrence. */
+    if (didfind && fileptr == openfile->current &&
+               fileptr_x == openfile->current_x)
+       statusbar(_("This is the only occurrence"));
 
     openfile->placewewant = xplustabs();
     edit_redraw(fileptr, pww_save);