Don't expand filenames during autocmd

This commit is contained in:
Marco Hinz 2017-01-11 14:16:43 +01:00
parent bd8025727c
commit 30f775f8a6
No known key found for this signature in database
GPG Key ID: 1C980A1B657B4A4F

View File

@ -6716,8 +6716,9 @@ static bool apply_autocmds_group(event_T event, char_u *fname, char_u *fname_io,
fname = vim_strsave(fname); /* make a copy, so we can change it */
} else {
sfname = vim_strsave(fname);
// don't try expanding the following events
// Don't try expanding the following events.
if (event == EVENT_COLORSCHEME
|| event == EVENT_DIRCHANGED
|| event == EVENT_FILETYPE
|| event == EVENT_FUNCUNDEFINED
|| event == EVENT_OPTIONSET
@ -6726,10 +6727,11 @@ static bool apply_autocmds_group(event_T event, char_u *fname, char_u *fname_io,
|| event == EVENT_REMOTEREPLY
|| event == EVENT_SPELLFILEMISSING
|| event == EVENT_SYNTAX
|| event == EVENT_TABCLOSED)
|| event == EVENT_TABCLOSED) {
fname = vim_strsave(fname);
else
fname = (char_u *)FullName_save((char *)fname, FALSE);
} else {
fname = (char_u *)FullName_save((char *)fname, false);
}
}
if (fname == NULL) { /* out of memory */
xfree(sfname);