]> git.wh0rd.org Git - nano.git/commitdiff
Checking the value of shortcut->toggle only if it actually is a toggle.
authorBenno Schulenberg <bensberg@justemail.net>
Mon, 3 Aug 2015 08:03:22 +0000 (08:03 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Mon, 3 Aug 2015 08:03:22 +0000 (08:03 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5339 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/rcfile.c

index 6274f602882263bd1e7423f552b28bb68f4d05c5..590f3636be60dcc9f4ed918de25fd28533537283 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-08-03  Benno Schulenberg  <bensberg@justemail.net>
+       * src/rcfile.c (parse_binding): Check value of shortcut->toggle
+       only if it actually is a toggle.  Found with valgrind.
+
 2015-08-02  Benno Schulenberg  <bensberg@justemail.net>
        * src/files.c (initialize_buffer): Initialize also openfile->syntax.
        This addresses Debian bug #787914 reported by Paul Wise.
index 2f9332339a4987a1b822987b6a21d7187e9d6f9d..da7b32cf0ebbcaba83f5caa582d0ac8deab46622 100644 (file)
@@ -564,7 +564,7 @@ void parse_binding(char *ptr, bool dobind)
        /* If this is a toggle, copy its sequence number. */
        if (newsc->scfunc == do_toggle_void) {
            for (s = sclist; s != NULL; s = s->next)
-               if (newsc->toggle == s->toggle)
+               if (s->scfunc == do_toggle_void && s->toggle == newsc->toggle)
                    newsc->ordinal = s->ordinal;
        } else
            newsc->ordinal = 0;