# HG changeset patch # User vimboss # Date 1199304505 0 # Node ID e980e93d2ac2c7838acfd45fbf2de06939c929bf # Parent 48b22e2eb1ed7782c4dfb90051b64d6614fc6d3b updated for version 7.1-186 diff --git a/src/ex_docmd.c b/src/ex_docmd.c --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -7799,6 +7799,7 @@ static char_u *prev_dir = NULL; free_cd_dir() { vim_free(prev_dir); + prev_dir = NULL; } #endif @@ -9521,6 +9522,7 @@ eval_vars(src, srcstart, usedlen, lnump, *errormsg = (char_u *)_("E495: no autocommand file name to substitute for \"\""); return NULL; } + result = shorten_fname1(result); break; case SPEC_ABUF: /* buffer number for autocommand */ diff --git a/src/fileio.c b/src/fileio.c --- a/src/fileio.c +++ b/src/fileio.c @@ -5556,7 +5556,7 @@ make_bom(buf, name) #endif #if defined(FEAT_VIMINFO) || defined(FEAT_BROWSE) || \ - defined(FEAT_QUICKFIX) || defined(PROTO) + defined(FEAT_QUICKFIX) || defined(FEAT_AUTOCMD) || defined(PROTO) /* * Try to find a shortname by comparing the fullname with the current * directory. @@ -8546,6 +8546,8 @@ apply_autocmds_group(event, fname, fname /* * Set the file name to be used for . + * Make a copy to avoid that changing a buffer name or directory makes it + * invalid. */ if (fname_io == NULL) { @@ -8558,6 +8560,8 @@ apply_autocmds_group(event, fname, fname } else autocmd_fname = fname_io; + if (autocmd_fname != NULL) + autocmd_fname = FullName_save(autocmd_fname, FALSE); /* * Set the buffer number to be used for . @@ -8740,6 +8744,7 @@ apply_autocmds_group(event, fname, fname vim_free(sourcing_name); sourcing_name = save_sourcing_name; sourcing_lnum = save_sourcing_lnum; + vim_free(autocmd_fname); autocmd_fname = save_autocmd_fname; autocmd_bufnr = save_autocmd_bufnr; autocmd_match = save_autocmd_match; diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -667,6 +667,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 186, +/**/ 185, /**/ 184,