]> granicus.if.org Git - vim/commitdiff
patch 8.1.1115: cannot build with older C compiler v8.1.1115
authorBram Moolenaar <Bram@vim.org>
Thu, 4 Apr 2019 13:40:56 +0000 (15:40 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 4 Apr 2019 13:40:56 +0000 (15:40 +0200)
Problem:    Cannot build with older C compiler.
Solution:   Move variable declaration to start of block.

src/autocmd.c
src/version.c

index 9a758c8a4545b9d7a3d6f1cc73ab9f0f358c8539..aa1114333793c50df5c3253bbf01b271af9b1108 100644 (file)
@@ -391,10 +391,10 @@ au_cleanup(void)
        prev_ap = &(first_autopat[(int)event]);
        for (ap = *prev_ap; ap != NULL; ap = *prev_ap)
        {
-           // loop over all commands for this pattern
-           prev_ac = &(ap->cmds);
            int has_cmd = FALSE;
 
+           // loop over all commands for this pattern
+           prev_ac = &(ap->cmds);
            for (ac = *prev_ac; ac != NULL; ac = *prev_ac)
            {
                // remove the command if the pattern is to be deleted or when
@@ -405,17 +405,17 @@ au_cleanup(void)
                    vim_free(ac->cmd);
                    vim_free(ac);
                }
-               else {
+               else
+               {
                    has_cmd = TRUE;
                    prev_ac = &(ac->next);
                }
            }
 
-           if (ap->pat != NULL && !has_cmd) {
+           if (ap->pat != NULL && !has_cmd)
                // Pattern was not marked for deletion, but all of its
                // commands were.  So mark the pattern for deletion.
                au_remove_pat(ap);
-           }
 
            // remove the pattern if it has been marked for deletion
            if (ap->pat == NULL)
index 0b86e191f798fb90a453ed738cb46fe587e4ec2b..9f65ca624dd5b38150aefb8bbd5d4d66f7a06175 100644 (file)
@@ -771,6 +771,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1115,
 /**/
     1114,
 /**/