changeset 13174:1bf3519889d3 v8.0.1461

patch 8.0.1461: missing another file in patch commit https://github.com/vim/vim/commit/15833239a4131279935a4bd574b74fe3a2b0f49f Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 3 18:33:17 2018 +0100 patch 8.0.1461: missing another file in patch Problem: Missing another file in patch. Solution: Add changes to missing file.
author Christian Brabandt <cb@256bit.org>
date Sat, 03 Feb 2018 18:45:05 +0100
parents 7babbf8be763
children 846a2791f798
files src/ex_cmds.c src/version.c
diffstat 2 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -4368,8 +4368,22 @@ do_ecmd(
     if (p_im)
 	need_start_insertmode = TRUE;
 
-    /* Change directories when the 'acd' option is set. */
-    DO_AUTOCHDIR
+#ifdef FEAT_AUTOCHDIR
+    /* Change directories when the 'acd' option is set and we aren't already in
+     * that directory (should already be done above). Expect getcwd() to be
+     * faster than calling shorten_fnames() unnecessarily. */
+    if (p_acd && curbuf->b_ffname != NULL)
+    {
+	char_u	curdir[MAXPATHL];
+	char_u	filedir[MAXPATHL];
+
+	vim_strncpy(filedir, curbuf->b_ffname, MAXPATHL - 1);
+	*gettail_sep(filedir) = NUL;
+	if (mch_dirname(curdir, MAXPATHL) != FAIL
+		&& vim_fnamecmp(curdir, filedir) != 0)
+	    do_autochdir();
+    }
+#endif
 
 #if defined(FEAT_SUN_WORKSHOP) || defined(FEAT_NETBEANS_INTG)
     if (curbuf->b_ffname != NULL)
--- a/src/version.c
+++ b/src/version.c
@@ -772,6 +772,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1461,
+/**/
     1460,
 /**/
     1459,