]> granicus.if.org Git - vim/commitdiff
updated for version 7.2c-002 v7.2c.002
authorBram Moolenaar <Bram@vim.org>
Fri, 8 Aug 2008 10:59:17 +0000 (10:59 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 8 Aug 2008 10:59:17 +0000 (10:59 +0000)
runtime/doc/eval.txt
src/ex_getln.c
src/version.c

index 8bb990a05e0ede78e14f185f27ad181edd932d85..3e24133c39c5a41a147b519ea1b1018523f44a3e 100644 (file)
@@ -2832,11 +2832,13 @@ fnameescape({string})                                   *fnameescape()*
                For most systems the characters escaped are
                " \t\n*?[{`$\\%#'\"|!<".  For systems where a backslash
                appears in a filename, it depends on the value of 'isfname'.
+               A leading '+' and '>' is also escaped (special after |:edit|
+               and |:write|).  And a "-" by itself (special after |:cd|).
                Example: >
-                       :let fname = 'some str%nge|name'
+                       :let fname = '+some str%nge|name'
                        :exe "edit " . fnameescape(fname)
 <              results in executing: >
-                       edit some\ str\%nge\|name
+                       edit \+some\ str\%nge\|name
 
 fnamemodify({fname}, {mods})                           *fnamemodify()*
                Modify file name {fname} according to {mods}.  {mods} is a
index c9760d1dba9d377415a72a6da1f6e15bef150897..994fe2aa34704e275de0e5d7212ac53375a30b48 100644 (file)
@@ -3717,7 +3717,7 @@ vim_strsave_fnameescape(fname, shell)
        if ((*p != '[' && *p != '{') || !vim_isfilec(*p))
            buf[j++] = *p;
     buf[j] = NUL;
-    return vim_strsave_escaped(fname, buf);
+    p = vim_strsave_escaped(fname, buf);
 #else
     p = vim_strsave_escaped(fname, shell ? SHELL_ESC_CHARS : PATH_ESC_CHARS);
     if (shell && csh_like_shell() && p != NULL)
@@ -3730,8 +3730,14 @@ vim_strsave_fnameescape(fname, shell)
        vim_free(p);
        p = s;
     }
-    return p;
 #endif
+
+    /* '>' and '+' are special at the start of some commands, e.g. ":edit" and
+     * ":write".  "cd -" has a special meaning. */
+    if (*p == '>' || *p == '+' || (*p == '-' && p[1] == NUL))
+       escape_fname(&p);
+
+    return p;
 }
 
 /*
index c8565c447a9f2989015e6f0fdeb5b2cb4720f744..6730cc0fd778e7e6f0cb2d6e7fad9fae8bb4c876 100644 (file)
@@ -676,6 +676,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2,
 /**/
     1,
 /**/