From e99d1a7fbbb663bfacf583c939d4718e4a7d5107 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 16 Aug 2020 21:50:20 -0400 Subject: vim-patch:8.1.1115: cannot build with older C compiler Problem: Cannot build with older C compiler. Solution: Move variable declaration to start of block. https://github.com/vim/vim/commit/8f4aeb5572d604d1540ee0cb7e721b5f0cc6d612 --- src/nvim/fileio.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/nvim/fileio.c') diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index f922591d0b..7740673bbe 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -5553,7 +5553,6 @@ static void au_del_cmd(AutoCmd *ac) static void au_cleanup(void) { AutoPat *ap, **prev_ap; - AutoCmd *ac, **prev_ac; event_T event; if (autocmd_busy || !au_need_clean) { @@ -5566,11 +5565,11 @@ static void au_cleanup(void) // Loop over all autocommand patterns. 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); bool has_cmd = false; - for (ac = *prev_ac; ac != NULL; ac = *prev_ac) { + // Loop over all commands for this pattern. + AutoCmd **prev_ac = &(ap->cmds); + for (AutoCmd *ac = *prev_ac; ac != NULL; ac = *prev_ac) { // Remove the command if the pattern is to be deleted or when // the command has been marked for deletion. if (ap->pat == NULL || ac->cmd == NULL) { -- cgit