Mercurial > vim
comparison src/autocmd.c @ 16221:331dc836f866 v8.1.1115
patch 8.1.1115: cannot build with older C compiler
commit https://github.com/vim/vim/commit/8f4aeb5572d604d1540ee0cb7e721b5f0cc6d612
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Apr 4 15:40:56 2019 +0200
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 04 Apr 2019 15:45:05 +0200 |
parents | 81e6940504e8 |
children | 0f65f2808470 |
comparison
equal
deleted
inserted
replaced
16220:56c09904eb91 | 16221:331dc836f866 |
---|---|
389 { | 389 { |
390 // loop over all autocommand patterns | 390 // loop over all autocommand patterns |
391 prev_ap = &(first_autopat[(int)event]); | 391 prev_ap = &(first_autopat[(int)event]); |
392 for (ap = *prev_ap; ap != NULL; ap = *prev_ap) | 392 for (ap = *prev_ap; ap != NULL; ap = *prev_ap) |
393 { | 393 { |
394 int has_cmd = FALSE; | |
395 | |
394 // loop over all commands for this pattern | 396 // loop over all commands for this pattern |
395 prev_ac = &(ap->cmds); | 397 prev_ac = &(ap->cmds); |
396 int has_cmd = FALSE; | |
397 | |
398 for (ac = *prev_ac; ac != NULL; ac = *prev_ac) | 398 for (ac = *prev_ac; ac != NULL; ac = *prev_ac) |
399 { | 399 { |
400 // remove the command if the pattern is to be deleted or when | 400 // remove the command if the pattern is to be deleted or when |
401 // the command has been marked for deletion | 401 // the command has been marked for deletion |
402 if (ap->pat == NULL || ac->cmd == NULL) | 402 if (ap->pat == NULL || ac->cmd == NULL) |
403 { | 403 { |
404 *prev_ac = ac->next; | 404 *prev_ac = ac->next; |
405 vim_free(ac->cmd); | 405 vim_free(ac->cmd); |
406 vim_free(ac); | 406 vim_free(ac); |
407 } | 407 } |
408 else { | 408 else |
409 { | |
409 has_cmd = TRUE; | 410 has_cmd = TRUE; |
410 prev_ac = &(ac->next); | 411 prev_ac = &(ac->next); |
411 } | 412 } |
412 } | 413 } |
413 | 414 |
414 if (ap->pat != NULL && !has_cmd) { | 415 if (ap->pat != NULL && !has_cmd) |
415 // Pattern was not marked for deletion, but all of its | 416 // Pattern was not marked for deletion, but all of its |
416 // commands were. So mark the pattern for deletion. | 417 // commands were. So mark the pattern for deletion. |
417 au_remove_pat(ap); | 418 au_remove_pat(ap); |
418 } | |
419 | 419 |
420 // remove the pattern if it has been marked for deletion | 420 // remove the pattern if it has been marked for deletion |
421 if (ap->pat == NULL) | 421 if (ap->pat == NULL) |
422 { | 422 { |
423 if (ap->next == NULL) | 423 if (ap->next == NULL) |