]> granicus.if.org Git - vim/commitdiff
updated for version 7.1-186 v7.1.186
authorBram Moolenaar <Bram@vim.org>
Wed, 2 Jan 2008 20:08:25 +0000 (20:08 +0000)
committerBram Moolenaar <Bram@vim.org>
Wed, 2 Jan 2008 20:08:25 +0000 (20:08 +0000)
src/ex_docmd.c
src/fileio.c
src/version.c

index d44fcb416d8e1d53a82876204221ce6acf6db06d..c6a4bafacd58a0fa101983e521eeda9d5bbb1fd7 100644 (file)
@@ -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, escaped)
                    *errormsg = (char_u *)_("E495: no autocommand file name to substitute for \"<afile>\"");
                    return NULL;
                }
+               result = shorten_fname1(result);
                break;
 
        case SPEC_ABUF:         /* buffer number for autocommand */
index f6a4da791ff38cc654589d921966d2b131c12e68..bcf355250cf463d6e86beb81e2ee6f62e68e1298 100644 (file)
@@ -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_io, force, group, buf, eap)
 
     /*
      * Set the file name to be used for <afile>.
+     * 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_io, force, group, buf, eap)
     }
     else
        autocmd_fname = fname_io;
+    if (autocmd_fname != NULL)
+       autocmd_fname = FullName_save(autocmd_fname, FALSE);
 
     /*
      * Set the buffer number to be used for <abuf>.
@@ -8740,6 +8744,7 @@ apply_autocmds_group(event, fname, fname_io, force, group, buf, eap)
     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;
index cb266270c41b6f1ccb3309c8cb5c7044cc1a6ae2..587e05dd3f06f2dfa21e944ea7c66cbac04f25ac 100644 (file)
@@ -666,6 +666,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    186,
 /**/
     185,
 /**/