Mercurial > vim
comparison src/fileio.c @ 1962:ba2ac6b5bfb9 v7.2.259
updated for version 7.2-259
author | vimboss |
---|---|
date | Fri, 11 Sep 2009 15:24:31 +0000 |
parents | 7317e0e27758 |
children | 1f53050b3868 |
comparison
equal
deleted
inserted
replaced
1961:0a1d45e2d8e3 | 1962:ba2ac6b5bfb9 |
---|---|
9496 * If there isn't any, return FALSE; | 9496 * If there isn't any, return FALSE; |
9497 * If there is one and no pattern given, return TRUE; */ | 9497 * If there is one and no pattern given, return TRUE; */ |
9498 ap = first_autopat[(int)event]; | 9498 ap = first_autopat[(int)event]; |
9499 if (ap == NULL) | 9499 if (ap == NULL) |
9500 goto theend; | 9500 goto theend; |
9501 if (pattern == NULL) | |
9502 { | |
9503 retval = TRUE; | |
9504 goto theend; | |
9505 } | |
9506 | 9501 |
9507 /* if pattern is "<buffer>", special handling is needed which uses curbuf */ | 9502 /* if pattern is "<buffer>", special handling is needed which uses curbuf */ |
9508 /* for pattern "<buffer=N>, fnamecmp() will work fine */ | 9503 /* for pattern "<buffer=N>, fnamecmp() will work fine */ |
9509 if (STRICMP(pattern, "<buffer>") == 0) | 9504 if (pattern != NULL && STRICMP(pattern, "<buffer>") == 0) |
9510 buflocal_buf = curbuf; | 9505 buflocal_buf = curbuf; |
9511 | 9506 |
9512 /* Check if there is an autocommand with the given pattern. */ | 9507 /* Check if there is an autocommand with the given pattern. */ |
9513 for ( ; ap != NULL; ap = ap->next) | 9508 for ( ; ap != NULL; ap = ap->next) |
9514 /* only use a pattern when it has not been removed and has commands. */ | 9509 /* only use a pattern when it has not been removed and has commands. */ |
9515 /* For buffer-local autocommands, fnamecmp() works fine. */ | 9510 /* For buffer-local autocommands, fnamecmp() works fine. */ |
9516 if (ap->pat != NULL && ap->cmds != NULL | 9511 if (ap->pat != NULL && ap->cmds != NULL |
9517 && (group == AUGROUP_ALL || ap->group == group) | 9512 && (group == AUGROUP_ALL || ap->group == group) |
9518 && (buflocal_buf == NULL | 9513 && (pattern == NULL |
9519 ? fnamecmp(ap->pat, pattern) == 0 | 9514 || (buflocal_buf == NULL |
9520 : ap->buflocal_nr == buflocal_buf->b_fnum)) | 9515 ? fnamecmp(ap->pat, pattern) == 0 |
9516 : ap->buflocal_nr == buflocal_buf->b_fnum))) | |
9521 { | 9517 { |
9522 retval = TRUE; | 9518 retval = TRUE; |
9523 break; | 9519 break; |
9524 } | 9520 } |
9525 | 9521 |