]> git.wh0rd.org Git - nano.git/commitdiff
No need to keep on looping when two shortcuts were found.
authorBenno Schulenberg <bensberg@justemail.net>
Tue, 13 May 2014 20:34:15 +0000 (20:34 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Tue, 13 May 2014 20:34:15 +0000 (20:34 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4876 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/help.c

index 54c7f283699c3aacdc07d70c5075e47036e60ce5..de2fdc5d47255d4c582e0bc04ca64d1e90f0311c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@
        lists with functions and shortcuts.
        * src/*.c: Several random whitespace and comment tweaks.
        * src/global.c (replace_scs_for): Condense the function a bit.
+       * src/help.c (help_init): No need to keep looping when two are found.
 
 2014-05-12  Benno Schulenberg  <bensberg@justemail.net>
        * src/text.c (do_spell): Provide startup feedback, as for the linter.
index ee4717b06fdf0ff2c5b74e37ab8f05b69100f02f..ea6b92419afded72a28e337d10ac5a8b33cbdb1b 100644 (file)
@@ -425,9 +425,6 @@ void help_init(void)
        /* Let's simply show the first two shortcuts from the list. */
        for (s = sclist, scsfound = 0; s != NULL; s = s->next) {
 
-           if (scsfound == 2)
-               continue;
-
            if (s->type == RAWINPUT)
                continue;
 
@@ -443,6 +440,7 @@ void help_init(void)
                    ptr += 6;
                } else {
                    ptr += sprintf(ptr, "(%s)\t", s->keystr);
+                   break;
                }
            }
        }