[SCM] Vim packaging branch, maint/etch, updated. 4cbe8d79068a51948a85acf10840cb751e812c72
James Vega
jamessan at debian.org
Tue Feb 17 21:20:24 UTC 2009
The following commit has been merged in the maint/etch branch:
commit 6d142fedab2eb2b8678d46349339683d35a1b1b8
Author: James Vega <jamessan at debian.org>
Date: Fri Feb 13 11:57:43 2009 -0500
Backport patches 7.2a.013, 7.2b.{005,018}, 7.2c.002, 7.2.{010,026}
debian/rules needed changes to the extract target to ensure patches are
applied in the proper order -- sort orders 7.2[abc] after 7.2.
The 7.2[abc] patches improve the functionality of the shellescape/fnameescape
functions (the base functions used for fixing the vulnerabilities in the
runtime scripts).
The 7.2 patches fix CVE 2008-4104.
Signed-off-by: James Vega <jamessan at debian.org>
diff --git a/debian/changelog b/debian/changelog
index 1304c89..03b33d6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,10 @@
vim (1:7.0-122+1etch4) UNRELEASED; urgency=high
* Backport upstream patches and runtime fixes for filename escaping
- vulnerabilities. (Closes: #486502, CVE 2008-2712, CVE 2008-3074)
- - Add upstream patches 7.1.299, 7.1.300, 7.1.305.
+ vulnerabilities. (Closes: #486502, CVE 2008-2712, CVE 2008-3074,
+ CVE 2008-4104)
+ - Backport patches 7.1.299, 7.1.300, 7.1.305, 7.2a.013, 7.2b.005,
+ 7.2b.018, 7.2c.002, 7.2010, 7.2026.
- Add patch CVE-2008-2712-xpm.vim.diff to fix syntax/xpm.vim and
syntax/xpm2.vim.
- Add patch CVE-2008-2712-zip.vim.diff to fix autoload/zip.vim.
diff --git a/debian/rules b/debian/rules
index aa0f362..f1b208e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -221,10 +221,20 @@ extract-stamp: $(foreach s,$(SOURCES),extract-stamp-$(s))
if [ ! -L vim -o "`readlink vim`" != "$(VIMCUR)" ]; then \
ln -fs $(SRCDIR) vim; \
fi
- # Add 7.1 patches for upstream's fix for CVE-2007-2953
- @for f in `find upstream/patches -type f -name '$(VERSION).*' -printf "%P\n" -o -type f -name "7.1.*" -printf "%P\n" | grep -v .svn | sort -n` ; do\
- echo "applying upstream patch: $$f" ;\
- cat upstream/patches/$$f | patch -s -d$(SRCDIR) -p0 ;\
+# Add 7.1/7.2[abc] patches for upstream's fix for CVE-2007-2953 & CVE-2008-2712
+ @for f in $$(find upstream/patches -type f -name "7.[01]*" | sort -n) ; do\
+ echo "applying upstream patch: $$(basename $$f)" ;\
+ cat $$f | patch -s -d$(SRCDIR) -p0 ;\
+ done
+# Need separate loops to ensure 7.2[abc] get applied first
+ @for f in $$(find upstream/patches -type f -name "7.2[abc]*" | sort -n) ; do\
+ echo "applying upstream patch: $$(basename $$f)" ;\
+ cat $$f | patch -s -d$(SRCDIR) -p0 ;\
+ done
+# Add 7.2 patches for upstream's fix for CVE-2008-4104
+ @for f in $$(find upstream/patches -type f -name "7.2.*" | sort -n) ; do\
+ echo "applying upstream patch: $$(basename $$f)" ;\
+ cat $$f | patch -s -d$(SRCDIR) -p0 ;\
done
quilt push -a
touch $@
diff --git a/upstream/patches/7.2.010 b/upstream/patches/7.2.010
new file mode 100644
index 0000000..a8aa044
--- /dev/null
+++ b/upstream/patches/7.2.010
@@ -0,0 +1,206 @@
+To: vim-dev at vim.org
+Subject: Patch 7.2.010
+Fcc: outbox
+From: Bram Moolenaar <Bram at moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2.010
+Problem: When using "K" in Visual mode not all characters are properly
+ escaped. (Ben Schmidt)
+Solution: Use a function with the functionality of shellescape(). (Jan
+ Minar)
+Files: src/mbyte.c, src/misc2.c, src/normal.c
+
+
+*** ../vim-7.2.009/src/mbyte.c Wed Aug 6 18:45:36 2008
+--- src/mbyte.c Wed Sep 3 22:34:48 2008
+***************
+*** 2509,2515 ****
+ return (int)(p - q);
+ }
+
+- #if defined(FEAT_EVAL) || defined(PROTO)
+ /*
+ * Copy a character from "*fp" to "*tp" and advance the pointers.
+ */
+--- 2509,2514 ----
+***************
+*** 2524,2530 ****
+ *tp += l;
+ *fp += l;
+ }
+- #endif
+
+ /*
+ * Return the offset from "p" to the first byte of a character. When "p" is
+--- 2523,2528 ----
+*** ../vim-7.2.009/src/misc2.c Thu Jul 24 20:28:58 2008
+--- src/misc2.c Wed Sep 3 22:05:21 2008
+***************
+*** 1229,1235 ****
+ return escaped_string;
+ }
+
+- #if !defined(BACKSLASH_IN_FILENAME) || defined(FEAT_EVAL) || defined(PROTO)
+ /*
+ * Return TRUE when 'shell' has "csh" in the tail.
+ */
+--- 1229,1234 ----
+***************
+*** 1238,1246 ****
+ {
+ return (strstr((char *)gettail(p_sh), "csh") != NULL);
+ }
+- #endif
+
+- #if defined(FEAT_EVAL) || defined(PROTO)
+ /*
+ * Escape "string" for use as a shell argument with system().
+ * This uses single quotes, except when we know we need to use double qoutes
+--- 1237,1243 ----
+***************
+*** 1363,1369 ****
+
+ return escaped_string;
+ }
+- #endif
+
+ /*
+ * Like vim_strsave(), but make all characters uppercase.
+--- 1360,1365 ----
+*** ../vim-7.2.009/src/normal.c Thu Jul 31 22:03:54 2008
+--- src/normal.c Sat Sep 6 15:06:07 2008
+***************
+*** 5405,5410 ****
+--- 5405,5415 ----
+ STRCPY(buf, "he! ");
+ else
+ {
++ /* An external command will probably use an argument starting
++ * with "-" as an option. To avoid trouble we skip the "-". */
++ while (*ptr == '-')
++ ++ptr;
++
+ /* When a count is given, turn it into a range. Is this
+ * really what we want? */
+ isman = (STRCMP(kp, "man") == 0);
+***************
+*** 5447,5483 ****
+ /*
+ * Now grab the chars in the identifier
+ */
+! if (cmdchar == '*')
+! aux_ptr = (char_u *)(p_magic ? "/.*~[^$\\" : "/^$\\");
+! else if (cmdchar == '#')
+! aux_ptr = (char_u *)(p_magic ? "/?.*~[^$\\" : "/?^$\\");
+! else if (cmdchar == 'K' && !kp_help)
+! aux_ptr = (char_u *)" \t\\\"|!";
+! else
+! /* Don't escape spaces and Tabs in a tag with a backslash */
+! aux_ptr = (char_u *)"\\|\"";
+!
+! p = buf + STRLEN(buf);
+! while (n-- > 0)
+! {
+! /* put a backslash before \ and some others */
+! if (vim_strchr(aux_ptr, *ptr) != NULL)
+! *p++ = '\\';
+! #ifdef FEAT_MBYTE
+! /* When current byte is a part of multibyte character, copy all bytes
+! * of that character. */
+! if (has_mbyte)
+ {
+! int i;
+! int len = (*mb_ptr2len)(ptr) - 1;
+!
+! for (i = 0; i < len && n >= 1; ++i, --n)
+! *p++ = *ptr++;
+ }
+ #endif
+! *p++ = *ptr++;
+ }
+- *p = NUL;
+
+ /*
+ * Execute the command.
+--- 5452,5508 ----
+ /*
+ * Now grab the chars in the identifier
+ */
+! if (cmdchar == 'K' && !kp_help)
+! {
+! /* Escape the argument properly for a shell command */
+! p = vim_strsave_shellescape(ptr, TRUE);
+! if (p == NULL)
+ {
+! vim_free(buf);
+! return;
+ }
++ buf = (char_u *)vim_realloc(buf, STRLEN(buf) + STRLEN(p) + 1);
++ if (buf == NULL)
++ {
++ vim_free(buf);
++ vim_free(p);
++ return;
++ }
++ STRCAT(buf, p);
++ vim_free(p);
++ }
++ else
++ {
++ if (cmdchar == '*')
++ aux_ptr = (char_u *)(p_magic ? "/.*~[^$\\" : "/^$\\");
++ else if (cmdchar == '#')
++ aux_ptr = (char_u *)(p_magic ? "/?.*~[^$\\" : "/?^$\\");
++ else
++ /* Don't escape spaces and Tabs in a tag with a backslash */
++ aux_ptr = (char_u *)"\\|\"\n*?[";
++
++ p = buf + STRLEN(buf);
++ while (n-- > 0)
++ {
++ /* put a backslash before \ and some others */
++ if (vim_strchr(aux_ptr, *ptr) != NULL)
++ *p++ = '\\';
++ #ifdef FEAT_MBYTE
++ /* When current byte is a part of multibyte character, copy all
++ * bytes of that character. */
++ if (has_mbyte)
++ {
++ int i;
++ int len = (*mb_ptr2len)(ptr) - 1;
++
++ for (i = 0; i < len && n >= 1; ++i, --n)
++ *p++ = *ptr++;
++ }
+ #endif
+! *p++ = *ptr++;
+! }
+! *p = NUL;
+ }
+
+ /*
+ * Execute the command.
+*** ../vim-7.2.009/src/version.c Mon Sep 1 17:56:05 2008
+--- src/version.c Sat Sep 6 16:26:42 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 10,
+ /**/
+
+--
+Q. What happens to programmers when they die?
+A: MS-Windows programmers are reinstalled. C++ programmers become undefined,
+ anyone who refers to them will die as well. Java programmers reincarnate
+ after being garbage collected.
+
+ /// Bram Moolenaar -- Bram at Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
diff --git a/upstream/patches/7.2.026 b/upstream/patches/7.2.026
new file mode 100644
index 0000000..9039ae2
--- /dev/null
+++ b/upstream/patches/7.2.026
@@ -0,0 +1,105 @@
+To: vim-dev at vim.org
+Subject: Patch 7.2.026
+Fcc: outbox
+From: Bram Moolenaar <Bram at moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2.026 (after 7.2.010)
+Problem: "K" doesn't use the length of the identifier but uses the rest of
+ the line.
+Solution: Copy the desired number of characters first.
+Files: src/normal.c
+
+
+*** ../vim-7.2.025/src/normal.c Thu Oct 2 22:55:17 2008
+--- src/normal.c Sat Nov 1 13:41:03 2008
+***************
+*** 179,184 ****
+--- 179,186 ----
+ static void nv_cursorhold __ARGS((cmdarg_T *cap));
+ #endif
+
++ static char *e_noident = N_("E349: No identifier under cursor");
++
+ /*
+ * Function to be called for a Normal or Visual mode command.
+ * The argument is a cmdarg_T.
+***************
+*** 3447,3453 ****
+ if (find_type & FIND_STRING)
+ EMSG(_("E348: No string under cursor"));
+ else
+! EMSG(_("E349: No identifier under cursor"));
+ return 0;
+ }
+ ptr += col;
+--- 3449,3455 ----
+ if (find_type & FIND_STRING)
+ EMSG(_("E348: No string under cursor"));
+ else
+! EMSG(_(e_noident));
+ return 0;
+ }
+ ptr += col;
+***************
+*** 5407,5414 ****
+ {
+ /* An external command will probably use an argument starting
+ * with "-" as an option. To avoid trouble we skip the "-". */
+! while (*ptr == '-')
+ ++ptr;
+
+ /* When a count is given, turn it into a range. Is this
+ * really what we want? */
+--- 5409,5425 ----
+ {
+ /* An external command will probably use an argument starting
+ * with "-" as an option. To avoid trouble we skip the "-". */
+! while (*ptr == '-' && n > 0)
+! {
+ ++ptr;
++ --n;
++ }
++ if (n == 0)
++ {
++ EMSG(_(e_noident)); /* found dashes only */
++ vim_free(buf);
++ return;
++ }
+
+ /* When a count is given, turn it into a range. Is this
+ * really what we want? */
+***************
+*** 5455,5461 ****
+--- 5466,5474 ----
+ if (cmdchar == 'K' && !kp_help)
+ {
+ /* Escape the argument properly for a shell command */
++ ptr = vim_strnsave(ptr, n);
+ p = vim_strsave_shellescape(ptr, TRUE);
++ vim_free(ptr);
+ if (p == NULL)
+ {
+ vim_free(buf);
+*** ../vim-7.2.025/src/version.c Thu Oct 2 22:55:17 2008
+--- src/version.c Sat Nov 1 13:50:53 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 26,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+161. You get up before the sun rises to check your e-mail, and you
+ find yourself in the very same chair long after the sun has set.
+
+ /// Bram Moolenaar -- Bram at Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
diff --git a/upstream/patches/7.2a.013 b/upstream/patches/7.2a.013
new file mode 100644
index 0000000..fe6126d
--- /dev/null
+++ b/upstream/patches/7.2a.013
@@ -0,0 +1,535 @@
+To: vim-dev at vim.org
+Subject: Patch 7.2a.013
+Fcc: outbox
+From: Bram Moolenaar <Bram at moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2a.013
+Problem: shellescape() does not escape "%" and "#" characters.
+Solution: Add find_cmdline_var() and use it when the second argument to
+ shellescape() is non-zero.
+Files: runtime/doc/eval.txt, src/eval.c, src/ex_docmd.c,
+ src/proto/ex_docmd.pro, src/proto/misc2.pro, src/misc2.c
+
+
+*** ../vim-7.2a.012/runtime/doc/eval.txt Tue Jun 24 23:55:33 2008
+--- runtime/doc/eval.txt Thu Jul 3 18:03:08 2008
+***************
+*** 1710,1716 ****
+ settabwinvar( {tabnr}, {winnr}, {varname}, {val}) set {varname} in window
+ {winnr} in tab page {tabnr} to {val}
+ setwinvar( {nr}, {varname}, {val}) set {varname} in window {nr} to {val}
+! shellescape( {string}) String escape {string} for use as shell
+ command argument
+ simplify( {filename}) String simplify filename as much as possible
+ sort( {list} [, {func}]) List sort {list}, using {func} to compare
+--- 1710,1717 ----
+ settabwinvar( {tabnr}, {winnr}, {varname}, {val}) set {varname} in window
+ {winnr} in tab page {tabnr} to {val}
+ setwinvar( {nr}, {varname}, {val}) set {varname} in window {nr} to {val}
+! shellescape( {string} [, {special}])
+! String escape {string} for use as shell
+ command argument
+ simplify( {filename}) String simplify filename as much as possible
+ sort( {list} [, {func}]) List sort {list}, using {func} to compare
+***************
+*** 4450,4468 ****
+ :call setwinvar(1, "&list", 0)
+ :call setwinvar(2, "myvar", "foobar")
+
+! shellescape({string}) *shellescape()*
+ Escape {string} for use as shell command argument.
+ On MS-Windows and MS-DOS, when 'shellslash' is not set, it
+! will enclose {string} double quotes and double all double
+ quotes within {string}.
+ For other systems, it will enclose {string} in single quotes
+ and replace all "'" with "'\''".
+! Example: >
+! :echo shellescape('c:\program files\vim')
+! < results in:
+! "c:\program files\vim" ~
+! Example usage: >
+! :call system("chmod +x -- " . shellescape(expand("%")))
+
+
+ simplify({filename}) *simplify()*
+--- 4456,4478 ----
+ :call setwinvar(1, "&list", 0)
+ :call setwinvar(2, "myvar", "foobar")
+
+! shellescape({string} [, {special}]) *shellescape()*
+ Escape {string} for use as shell command argument.
+ On MS-Windows and MS-DOS, when 'shellslash' is not set, it
+! will enclose {string} in double quotes and double all double
+ quotes within {string}.
+ For other systems, it will enclose {string} in single quotes
+ and replace all "'" with "'\''".
+! When the {special} argument is present and it's a non-zero
+! Number or a non-empty String (|non-zero-arg|), then special
+! items such as "%", "#" and "<cword>" will be preceded by a
+! backslash. This backslash will be removed again by the |:!|
+! command.
+! Example of use with a |:!| command: >
+! :exe '!dir ' . shellescape(expand('<cfile>'), 1)
+! < This results in a directory listing for the file under the
+! cursor. Example of use with |system()|: >
+! :call system("chmod +w -- " . shellescape(expand("%")))
+
+
+ simplify({filename}) *simplify()*
+***************
+*** 4787,4799 ****
+ passed as stdin to the command. The string is written as-is,
+ you need to take care of using the correct line separators
+ yourself. Pipes are not used.
+! Note: newlines in {expr} may cause the command to fail. The
+! characters in 'shellquote' and 'shellxquote' may also cause
+! trouble.
+ This is not to be used for interactive commands.
+- The result is a String. Example: >
+
+! :let files = system("ls")
+
+ < To make the result more system-independent, the shell output
+ is filtered to replace <CR> with <NL> for Macintosh, and
+--- 4797,4810 ----
+ passed as stdin to the command. The string is written as-is,
+ you need to take care of using the correct line separators
+ yourself. Pipes are not used.
+! Note: Use |shellescape()| to escape special characters in a
+! command argument. Newlines in {expr} may cause the command to
+! fail. The characters in 'shellquote' and 'shellxquote' may
+! also cause trouble.
+ This is not to be used for interactive commands.
+
+! The result is a String. Example: >
+! :let files = system("ls " . shellescape(expand('%:h')))
+
+ < To make the result more system-independent, the shell output
+ is filtered to replace <CR> with <NL> for Macintosh, and
+***************
+*** 6158,6163 ****
+--- 6171,6183 ----
+ :execute "normal ixxx\<Esc>"
+ < This has an <Esc> character, see |expr-string|.
+
++ Be careful to correctly escape special characters in
++ file names. The |fnameescape()| function can be used
++ for Vim commands, |shellescape()| for |:!| commands.
++ Examples: >
++ :execute "e " . fnameescape(filename)
++ :execute "!ls " . shellescape(expand('%:h'), 1)
++ <
+ Note: The executed string may be any command-line, but
+ you cannot start or end a "while", "for" or "if"
+ command. Thus this is illegal: >
+*** ../vim-7.2a.012/src/eval.c Sat Jun 28 15:09:03 2008
+--- src/eval.c Thu Jul 3 18:12:41 2008
+***************
+*** 455,460 ****
+--- 455,461 ----
+ static int get_func_tv __ARGS((char_u *name, int len, typval_T *rettv, char_u **arg, linenr_T firstline, linenr_T lastline, int *doesrange, int evaluate, dict_T *selfdict));
+ static int call_func __ARGS((char_u *name, int len, typval_T *rettv, int argcount, typval_T *argvars, linenr_T firstline, linenr_T lastline, int *doesrange, int evaluate, dict_T *selfdict));
+ static void emsg_funcname __ARGS((char *ermsg, char_u *name));
++ static int non_zero_arg __ARGS((typval_T *argvars));
+
+ static void f_add __ARGS((typval_T *argvars, typval_T *rettv));
+ static void f_append __ARGS((typval_T *argvars, typval_T *rettv));
+***************
+*** 7149,7155 ****
+ {"setreg", 2, 3, f_setreg},
+ {"settabwinvar", 4, 4, f_settabwinvar},
+ {"setwinvar", 3, 3, f_setwinvar},
+! {"shellescape", 1, 1, f_shellescape},
+ {"simplify", 1, 1, f_simplify},
+ {"sort", 1, 2, f_sort},
+ {"soundfold", 1, 1, f_soundfold},
+--- 7150,7156 ----
+ {"setreg", 2, 3, f_setreg},
+ {"settabwinvar", 4, 4, f_settabwinvar},
+ {"setwinvar", 3, 3, f_setwinvar},
+! {"shellescape", 1, 2, f_shellescape},
+ {"simplify", 1, 1, f_simplify},
+ {"sort", 1, 2, f_sort},
+ {"soundfold", 1, 1, f_soundfold},
+***************
+*** 7621,7626 ****
+--- 7622,7641 ----
+ vim_free(p);
+ }
+
++ /*
++ * Return TRUE for a non-zero Number and a non-empty String.
++ */
++ static int
++ non_zero_arg(argvars)
++ typval_T *argvars;
++ {
++ return ((argvars[0].v_type == VAR_NUMBER
++ && argvars[0].vval.v_number != 0)
++ || (argvars[0].v_type == VAR_STRING
++ && argvars[0].vval.v_string != NULL
++ && *argvars[0].vval.v_string != NUL));
++ }
++
+ /*********************************************
+ * Implementation of the built-in functions
+ */
+***************
+*** 14635,14641 ****
+ typval_T *argvars;
+ typval_T *rettv;
+ {
+! rettv->vval.v_string = vim_strsave_shellescape(get_tv_string(&argvars[0]));
+ rettv->v_type = VAR_STRING;
+ }
+
+--- 14649,14656 ----
+ typval_T *argvars;
+ typval_T *rettv;
+ {
+! rettv->vval.v_string = vim_strsave_shellescape(
+! get_tv_string(&argvars[0]), non_zero_arg(&argvars[1]));
+ rettv->v_type = VAR_STRING;
+ }
+
+***************
+*** 16088,16097 ****
+ rettv->vval.v_string = vim_strsave(str);
+
+ /* A non-zero number or non-empty string argument: reset mode. */
+! if ((argvars[0].v_type == VAR_NUMBER
+! && argvars[0].vval.v_number != 0)
+! || (argvars[0].v_type == VAR_STRING
+! && *get_tv_string(&argvars[0]) != NUL))
+ curbuf->b_visual_mode_eval = NUL;
+ #else
+ rettv->vval.v_number = 0; /* return anything, it won't work anyway */
+--- 16103,16109 ----
+ rettv->vval.v_string = vim_strsave(str);
+
+ /* A non-zero number or non-empty string argument: reset mode. */
+! if (non_zero_arg(&argvars[0]))
+ curbuf->b_visual_mode_eval = NUL;
+ #else
+ rettv->vval.v_number = 0; /* return anything, it won't work anyway */
+*** ../vim-7.2a.012/src/ex_docmd.c Tue Jun 24 22:28:02 2008
+--- src/ex_docmd.c Tue Jul 1 22:23:25 2008
+***************
+*** 6983,6990 ****
+
+ # ifdef FEAT_QUICKFIX
+ /* A ":split" in the quickfix window works like ":new". Don't want two
+! * quickfix windows. */
+! if (bt_quickfix(curbuf))
+ {
+ if (eap->cmdidx == CMD_split)
+ eap->cmdidx = CMD_new;
+--- 6983,6990 ----
+
+ # ifdef FEAT_QUICKFIX
+ /* A ":split" in the quickfix window works like ":new". Don't want two
+! * quickfix windows. But it's OK when doing ":tab split". */
+! if (bt_quickfix(curbuf) && cmdmod.tab == 0)
+ {
+ if (eap->cmdidx == CMD_split)
+ eap->cmdidx = CMD_new;
+***************
+*** 9240,9245 ****
+--- 9240,9297 ----
+ }
+
+ /*
++ * Check "str" for starting with a special cmdline variable.
++ * If found return one of the SPEC_ values and set "*usedlen" to the length of
++ * the variable. Otherwise return -1 and "*usedlen" is unchanged.
++ */
++ int
++ find_cmdline_var(src, usedlen)
++ char_u *src;
++ int *usedlen;
++ {
++ int len;
++ int i;
++ static char *(spec_str[]) = {
++ "%",
++ #define SPEC_PERC 0
++ "#",
++ #define SPEC_HASH 1
++ "<cword>", /* cursor word */
++ #define SPEC_CWORD 2
++ "<cWORD>", /* cursor WORD */
++ #define SPEC_CCWORD 3
++ "<cfile>", /* cursor path name */
++ #define SPEC_CFILE 4
++ "<sfile>", /* ":so" file name */
++ #define SPEC_SFILE 5
++ #ifdef FEAT_AUTOCMD
++ "<afile>", /* autocommand file name */
++ # define SPEC_AFILE 6
++ "<abuf>", /* autocommand buffer number */
++ # define SPEC_ABUF 7
++ "<amatch>", /* autocommand match name */
++ # define SPEC_AMATCH 8
++ #endif
++ #ifdef FEAT_CLIENTSERVER
++ "<client>"
++ # define SPEC_CLIENT 9
++ #endif
++ };
++ #define SPEC_COUNT (sizeof(spec_str) / sizeof(char *))
++
++ for (i = 0; i < SPEC_COUNT; ++i)
++ {
++ len = (int)STRLEN(spec_str[i]);
++ if (STRNCMP(src, spec_str[i], len) == 0)
++ {
++ *usedlen = len;
++ return i;
++ }
++ }
++ return -1;
++ }
++
++ /*
+ * Evaluate cmdline variables.
+ *
+ * change '%' to curbuf->b_ffname
+***************
+*** 9277,9310 ****
+ #ifdef FEAT_MODIFY_FNAME
+ int skip_mod = FALSE;
+ #endif
+- static char *(spec_str[]) =
+- {
+- "%",
+- #define SPEC_PERC 0
+- "#",
+- #define SPEC_HASH 1
+- "<cword>", /* cursor word */
+- #define SPEC_CWORD 2
+- "<cWORD>", /* cursor WORD */
+- #define SPEC_CCWORD 3
+- "<cfile>", /* cursor path name */
+- #define SPEC_CFILE 4
+- "<sfile>", /* ":so" file name */
+- #define SPEC_SFILE 5
+- #ifdef FEAT_AUTOCMD
+- "<afile>", /* autocommand file name */
+- # define SPEC_AFILE 6
+- "<abuf>", /* autocommand buffer number */
+- # define SPEC_ABUF 7
+- "<amatch>", /* autocommand match name */
+- # define SPEC_AMATCH 8
+- #endif
+- #ifdef FEAT_CLIENTSERVER
+- "<client>"
+- # define SPEC_CLIENT 9
+- #endif
+- };
+- #define SPEC_COUNT (sizeof(spec_str) / sizeof(char *))
+
+ #if defined(FEAT_AUTOCMD) || defined(FEAT_CLIENTSERVER)
+ char_u strbuf[30];
+--- 9329,9334 ----
+***************
+*** 9315,9327 ****
+ /*
+ * Check if there is something to do.
+ */
+! for (spec_idx = 0; spec_idx < SPEC_COUNT; ++spec_idx)
+! {
+! *usedlen = (int)STRLEN(spec_str[spec_idx]);
+! if (STRNCMP(src, spec_str[spec_idx], *usedlen) == 0)
+! break;
+! }
+! if (spec_idx == SPEC_COUNT) /* no match */
+ {
+ *usedlen = 1;
+ return NULL;
+--- 9339,9346 ----
+ /*
+ * Check if there is something to do.
+ */
+! spec_idx = find_cmdline_var(src, usedlen);
+! if (spec_idx < 0) /* no match */
+ {
+ *usedlen = 1;
+ return NULL;
+*** ../vim-7.2a.012/src/proto/ex_docmd.pro Sat Nov 24 21:49:59 2007
+--- src/proto/ex_docmd.pro Tue Jul 1 22:23:30 2008
+***************
+*** 44,49 ****
+--- 44,50 ----
+ extern FILE *open_exfile __ARGS((char_u *fname, int forceit, char *mode));
+ extern void update_topline_cursor __ARGS((void));
+ extern void exec_normal_cmd __ARGS((char_u *cmd, int remap, int silent));
++ extern int find_cmdline_var __ARGS((char_u *src, int *usedlen));
+ extern char_u *eval_vars __ARGS((char_u *src, int *usedlen, linenr_T *lnump, char_u **errormsg, char_u *srcstart));
+ extern char_u *expand_sfile __ARGS((char_u *arg));
+ extern int put_eol __ARGS((FILE *fd));
+*** ../vim-7.2a.012/src/proto/misc2.pro Wed Jun 25 00:45:23 2008
+--- src/proto/misc2.pro Wed Jul 2 22:39:49 2008
+***************
+*** 29,35 ****
+ extern char_u *vim_strnsave __ARGS((char_u *string, int len));
+ extern char_u *vim_strsave_escaped __ARGS((char_u *string, char_u *esc_chars));
+ extern char_u *vim_strsave_escaped_ext __ARGS((char_u *string, char_u *esc_chars, int cc, int bsl));
+! extern char_u *vim_strsave_shellescape __ARGS((char_u *string));
+ extern char_u *vim_strsave_up __ARGS((char_u *string));
+ extern char_u *vim_strnsave_up __ARGS((char_u *string, int len));
+ extern void vim_strup __ARGS((char_u *p));
+--- 29,35 ----
+ extern char_u *vim_strnsave __ARGS((char_u *string, int len));
+ extern char_u *vim_strsave_escaped __ARGS((char_u *string, char_u *esc_chars));
+ extern char_u *vim_strsave_escaped_ext __ARGS((char_u *string, char_u *esc_chars, int cc, int bsl));
+! extern char_u *vim_strsave_shellescape __ARGS((char_u *string, int do_special));
+ extern char_u *vim_strsave_up __ARGS((char_u *string));
+ extern char_u *vim_strnsave_up __ARGS((char_u *string, int len));
+ extern void vim_strup __ARGS((char_u *p));
+*** ../vim-7.2a.012/src/misc2.c Tue Jun 24 23:27:23 2008
+--- src/misc2.c Fri Jul 4 11:37:55 2008
+***************
+*** 1234,1249 ****
+ * Escape "string" for use as a shell argument with system().
+ * This uses single quotes, except when we know we need to use double qoutes
+ * (MS-DOS and MS-Windows without 'shellslash' set).
+ * Returns the result in allocated memory, NULL if we have run out.
+ */
+ char_u *
+! vim_strsave_shellescape(string)
+ char_u *string;
+ {
+ unsigned length;
+ char_u *p;
+ char_u *d;
+ char_u *escaped_string;
+
+ /* First count the number of extra bytes required. */
+ length = STRLEN(string) + 3; /* two quotes and the trailing NUL */
+--- 1234,1252 ----
+ * Escape "string" for use as a shell argument with system().
+ * This uses single quotes, except when we know we need to use double qoutes
+ * (MS-DOS and MS-Windows without 'shellslash' set).
++ * Also replace "%", "#" and things like "<cfile>" when "do_special" is TRUE.
+ * Returns the result in allocated memory, NULL if we have run out.
+ */
+ char_u *
+! vim_strsave_shellescape(string, do_special)
+ char_u *string;
++ int do_special;
+ {
+ unsigned length;
+ char_u *p;
+ char_u *d;
+ char_u *escaped_string;
++ int l;
+
+ /* First count the number of extra bytes required. */
+ length = STRLEN(string) + 3; /* two quotes and the trailing NUL */
+***************
+*** 1259,1264 ****
+--- 1262,1272 ----
+ # endif
+ if (*p == '\'')
+ length += 3; /* ' => '\'' */
++ if (do_special && find_cmdline_var(p, &l) >= 0)
++ {
++ ++length; /* insert backslash */
++ p += l - 1;
++ }
+ }
+
+ /* Allocate memory for the result and fill it. */
+***************
+*** 1292,1304 ****
+ # endif
+ if (*p == '\'')
+ {
+! *d++='\'';
+! *d++='\\';
+! *d++='\'';
+! *d++='\'';
+ ++p;
+ continue;
+ }
+
+ MB_COPY_CHAR(p, d);
+ }
+--- 1300,1318 ----
+ # endif
+ if (*p == '\'')
+ {
+! *d++ = '\'';
+! *d++ = '\\';
+! *d++ = '\'';
+! *d++ = '\'';
+ ++p;
+ continue;
+ }
++ if (do_special && find_cmdline_var(p, &l) >= 0)
++ {
++ *d++ = '\\'; /* insert backslash */
++ while (--l >= 0) /* copy the var */
++ *d++ = *p++;
++ }
+
+ MB_COPY_CHAR(p, d);
+ }
+***************
+*** 2748,2754 ****
+ return 0;
+ }
+
+! #ifdef FEAT_CMDL_COMPL
+ char_u *
+ get_key_name(i)
+ int i;
+--- 2762,2768 ----
+ return 0;
+ }
+
+! #if defined(FEAT_CMDL_COMPL) || defined(PROTO)
+ char_u *
+ get_key_name(i)
+ int i;
+***************
+*** 2759,2765 ****
+ }
+ #endif
+
+! #ifdef FEAT_MOUSE
+ /*
+ * Look up the given mouse code to return the relevant information in the other
+ * arguments. Return which button is down or was released.
+--- 2773,2779 ----
+ }
+ #endif
+
+! #if defined(FEAT_MOUSE) || defined(PROTO)
+ /*
+ * Look up the given mouse code to return the relevant information in the other
+ * arguments. Return which button is down or was released.
+*** ../vim-7.2a.012/src/version.c Wed Jul 2 21:04:36 2008
+--- src/version.c Fri Jul 4 11:27:40 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 13,
+ /**/
+
+--
+Although the scythe isn't pre-eminent among the weapons of war, anyone who
+has been on the wrong end of, say, a peasants' revolt will know that in
+skilled hands it is fearsome.
+ -- (Terry Pratchett, Mort)
+
+ /// Bram Moolenaar -- Bram at Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
diff --git a/upstream/patches/7.2b.005 b/upstream/patches/7.2b.005
new file mode 100644
index 0000000..b0b8dfd
--- /dev/null
+++ b/upstream/patches/7.2b.005
@@ -0,0 +1,103 @@
+To: vim-dev at vim.org
+Subject: Patch 7.2b.005
+Fcc: outbox
+From: Bram Moolenaar <Bram at moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2b.005
+Problem: The special character "!" isn't handled properly in shellescape().
+ (Jan Minar)
+Solution: Escape "!" when using a "csh" like shell and with
+ shellescape(s, 1). Twice for both. Also escape <NL>.
+Files: src/misc2.c
+
+
+*** ../vim-7.2b.004/src/misc2.c Fri Jul 4 11:43:30 2008
+--- src/misc2.c Wed Jul 16 22:40:33 2008
+***************
+*** 1234,1240 ****
+ * Escape "string" for use as a shell argument with system().
+ * This uses single quotes, except when we know we need to use double qoutes
+ * (MS-DOS and MS-Windows without 'shellslash' set).
+! * Also replace "%", "#" and things like "<cfile>" when "do_special" is TRUE.
+ * Returns the result in allocated memory, NULL if we have run out.
+ */
+ char_u *
+--- 1234,1242 ----
+ * Escape "string" for use as a shell argument with system().
+ * This uses single quotes, except when we know we need to use double qoutes
+ * (MS-DOS and MS-Windows without 'shellslash' set).
+! * Escape a newline, depending on the 'shell' option.
+! * When "do_special" is TRUE also replace "!", "%", "#" and things starting
+! * with "<" like "<cfile>".
+ * Returns the result in allocated memory, NULL if we have run out.
+ */
+ char_u *
+***************
+*** 1247,1252 ****
+--- 1249,1261 ----
+ char_u *d;
+ char_u *escaped_string;
+ int l;
++ int csh_like;
++
++ /* Only csh and similar shells expand '!' within single quotes. For sh and
++ * the like we must not put a backslash before it, it will be taken
++ * literally. If do_special is set the '!' will be escaped twice.
++ * Csh also needs to have "\n" escaped twice when do_special is set. */
++ csh_like = (strstr((char *)gettail(p_sh), "csh") != NULL);
+
+ /* First count the number of extra bytes required. */
+ length = STRLEN(string) + 3; /* two quotes and the trailing NUL */
+***************
+*** 1262,1267 ****
+--- 1271,1282 ----
+ # endif
+ if (*p == '\'')
+ length += 3; /* ' => '\'' */
++ if (*p == '\n' || (*p == '!' && (csh_like || do_special)))
++ {
++ ++length; /* insert backslash */
++ if (csh_like && do_special)
++ ++length; /* insert backslash */
++ }
+ if (do_special && find_cmdline_var(p, &l) >= 0)
+ {
+ ++length; /* insert backslash */
+***************
+*** 1307,1312 ****
+--- 1322,1335 ----
+ ++p;
+ continue;
+ }
++ if (*p == '\n' || (*p == '!' && (csh_like || do_special)))
++ {
++ *d++ = '\\';
++ if (csh_like && do_special)
++ *d++ = '\\';
++ *d++ = *p++;
++ continue;
++ }
+ if (do_special && find_cmdline_var(p, &l) >= 0)
+ {
+ *d++ = '\\'; /* insert backslash */
+*** ../vim-7.2b.004/src/version.c Mon Jul 14 23:04:13 2008
+--- src/version.c Wed Jul 16 22:31:54 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 5,
+ /**/
+
+--
+Place mark here ->[ ]<- if you want a dirty monitor.
+
+ /// Bram Moolenaar -- Bram at Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
diff --git a/upstream/patches/7.2b.018 b/upstream/patches/7.2b.018
new file mode 100644
index 0000000..7948091
--- /dev/null
+++ b/upstream/patches/7.2b.018
@@ -0,0 +1,228 @@
+To: vim-dev at vim.org
+Subject: Patch 7.2b.018
+Fcc: outbox
+From: Bram Moolenaar <Bram at moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2b.018
+Problem: When doing command line completion on a file name for a csh-like
+ shell argument a '!' character isn't escaped properly.
+Solution: Add another backslash.
+Files: src/ex_getln.c, src/misc2.c, src/proto/misc2.pro, src/screen.c
+
+
+*** ../vim-7.2b.017/src/ex_getln.c Tue Jun 24 23:49:23 2008
+--- src/ex_getln.c Thu Jul 24 10:36:42 2008
+***************
+*** 3656,3661 ****
+--- 3656,3662 ----
+ char_u *fname;
+ int shell;
+ {
++ char_u *p;
+ #ifdef BACKSLASH_IN_FILENAME
+ char_u buf[20];
+ int j = 0;
+***************
+*** 3667,3673 ****
+ buf[j] = NUL;
+ return vim_strsave_escaped(fname, buf);
+ #else
+! return vim_strsave_escaped(fname, shell ? SHELL_ESC_CHARS : PATH_ESC_CHARS);
+ #endif
+ }
+
+--- 3719,3736 ----
+ buf[j] = NUL;
+ return 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)
+! {
+! char_u *s;
+!
+! /* For csh and similar shells need to put two backslashes before '!'.
+! * One is taken by Vim, one by the shell. */
+! s = vim_strsave_escaped(p, (char_u *)"!");
+! vim_free(p);
+! p = s;
+! }
+! return p;
+ #endif
+ }
+
+***************
+*** 5882,5888 ****
+--- 5893,5901 ----
+ linenr_T lnum;
+ int histtype;
+ garray_T winsizes;
++ #ifdef FEAT_AUTOCMD
+ char_u typestr[2];
++ #endif
+ int save_restart_edit = restart_edit;
+ int save_State = State;
+ int save_exmode = exmode_active;
+*** ../vim-7.2b.017/src/misc2.c Wed Jul 16 22:42:51 2008
+--- src/misc2.c Wed Jul 23 21:12:56 2008
+***************
+*** 1229,1234 ****
+--- 1229,1245 ----
+ return escaped_string;
+ }
+
++ #if !defined(BACKSLASH_IN_FILENAME) || defined(FEAT_EVAL) || defined(PROTO)
++ /*
++ * Return TRUE when 'shell' has "csh" in the tail.
++ */
++ int
++ csh_like_shell()
++ {
++ return (strstr((char *)gettail(p_sh), "csh") != NULL);
++ }
++ #endif
++
+ #if defined(FEAT_EVAL) || defined(PROTO)
+ /*
+ * Escape "string" for use as a shell argument with system().
+***************
+*** 1255,1261 ****
+ * the like we must not put a backslash before it, it will be taken
+ * literally. If do_special is set the '!' will be escaped twice.
+ * Csh also needs to have "\n" escaped twice when do_special is set. */
+! csh_like = (strstr((char *)gettail(p_sh), "csh") != NULL);
+
+ /* First count the number of extra bytes required. */
+ length = STRLEN(string) + 3; /* two quotes and the trailing NUL */
+--- 1266,1272 ----
+ * the like we must not put a backslash before it, it will be taken
+ * literally. If do_special is set the '!' will be escaped twice.
+ * Csh also needs to have "\n" escaped twice when do_special is set. */
+! csh_like = csh_like_shell();
+
+ /* First count the number of extra bytes required. */
+ length = STRLEN(string) + 3; /* two quotes and the trailing NUL */
+*** ../vim-7.2b.017/src/proto/misc2.pro Fri Jul 4 11:44:02 2008
+--- src/proto/misc2.pro Wed Jul 23 21:12:59 2008
+***************
+*** 29,34 ****
+--- 29,35 ----
+ extern char_u *vim_strnsave __ARGS((char_u *string, int len));
+ extern char_u *vim_strsave_escaped __ARGS((char_u *string, char_u *esc_chars));
+ extern char_u *vim_strsave_escaped_ext __ARGS((char_u *string, char_u *esc_chars, int cc, int bsl));
++ extern int csh_like_shell __ARGS((void));
+ extern char_u *vim_strsave_shellescape __ARGS((char_u *string, int do_special));
+ extern char_u *vim_strsave_up __ARGS((char_u *string));
+ extern char_u *vim_strnsave_up __ARGS((char_u *string, int len));
+*** ../vim-7.2b.017/src/screen.c Fri Jul 18 17:11:39 2008
+--- src/screen.c Thu Jul 24 16:45:07 2008
+***************
+*** 5304,5311 ****
+
+ while (*s != NUL)
+ {
+! if (skip_status_match_char(xp, s))
+! ++s;
+ len += ptr2cells(s);
+ mb_ptr_adv(s);
+ }
+--- 5304,5310 ----
+
+ while (*s != NUL)
+ {
+! s += skip_status_match_char(xp, s);
+ len += ptr2cells(s);
+ mb_ptr_adv(s);
+ }
+***************
+*** 5314,5320 ****
+ }
+
+ /*
+! * Return TRUE for characters that are not displayed in a status match.
+ * These are backslashes used for escaping. Do show backslashes in help tags.
+ */
+ static int
+--- 5313,5319 ----
+ }
+
+ /*
+! * Return the number of characters that should be skipped in a status match.
+ * These are backslashes used for escaping. Do show backslashes in help tags.
+ */
+ static int
+***************
+*** 5322,5334 ****
+ expand_T *xp;
+ char_u *s;
+ {
+! return ((rem_backslash(s) && xp->xp_context != EXPAND_HELP)
+ #ifdef FEAT_MENU
+ || ((xp->xp_context == EXPAND_MENUS
+ || xp->xp_context == EXPAND_MENUNAMES)
+ && (s[0] == '\t' || (s[0] == '\\' && s[1] != NUL)))
+ #endif
+! );
+ }
+
+ /*
+--- 5321,5341 ----
+ expand_T *xp;
+ char_u *s;
+ {
+! if ((rem_backslash(s) && xp->xp_context != EXPAND_HELP)
+ #ifdef FEAT_MENU
+ || ((xp->xp_context == EXPAND_MENUS
+ || xp->xp_context == EXPAND_MENUNAMES)
+ && (s[0] == '\t' || (s[0] == '\\' && s[1] != NUL)))
+ #endif
+! )
+! {
+! #ifndef BACKSLASH_IN_FILENAME
+! if (xp->xp_shell && csh_like_shell() && s[1] == '\\' && s[2] == '!')
+! return 2;
+! #endif
+! return 1;
+! }
+! return 0;
+ }
+
+ /*
+***************
+*** 5466,5473 ****
+ #endif
+ for ( ; *s != NUL; ++s)
+ {
+! if (skip_status_match_char(xp, s))
+! ++s;
+ clen += ptr2cells(s);
+ #ifdef FEAT_MBYTE
+ if (has_mbyte && (l = (*mb_ptr2len)(s)) > 1)
+--- 5473,5479 ----
+ #endif
+ for ( ; *s != NUL; ++s)
+ {
+! s += skip_status_match_char(xp, s);
+ clen += ptr2cells(s);
+ #ifdef FEAT_MBYTE
+ if (has_mbyte && (l = (*mb_ptr2len)(s)) > 1)
+*** ../vim-7.2b.017/src/version.c Thu Jul 24 19:33:36 2008
+--- src/version.c Thu Jul 24 20:23:37 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 18,
+ /**/
+
+--
+Nothing is impossible for the man who doesn't have to do it.
+
+ /// Bram Moolenaar -- Bram at Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
diff --git a/upstream/patches/7.2c.002 b/upstream/patches/7.2c.002
new file mode 100644
index 0000000..e64b7ef
--- /dev/null
+++ b/upstream/patches/7.2c.002
@@ -0,0 +1,112 @@
+To: vim-dev at vim.org
+Subject: Patch 7.2c.002
+Fcc: outbox
+From: Bram Moolenaar <Bram at moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2c.002
+Problem: fnameescape() doesn't handle a leading '+' or '>'. (Jan Minar)
+Solution: Escape a leading '+' and '>'. And a single '-'.
+Files: runtime/doc/eval.txt, src/ex_getln.c
+
+
+*** ../vim-7.2c.001/runtime/doc/eval.txt Fri Aug 8 12:35:03 2008
+--- runtime/doc/eval.txt Fri Aug 8 11:33:35 2008
+***************
+*** 2557,2570 ****
+ Escape {string} for use as file name command argument. All
+ characters that have a special meaning, such as '%' and '|'
+ are escaped with a backslash.
+! For most systems the characters escaped are "". For systems
+! where a backslash appears in a filename, it depends on the
+! value of 'isfname'.
+ Example: >
+! :let fname = 'some str%nge|name'
+ :exe "edit " . fnameescape(fname)
+ < results in executing: >
+! edit some\ str\%nge\|name
+
+ fnamemodify({fname}, {mods}) *fnamemodify()*
+ Modify file name {fname} according to {mods}. {mods} is a
+--- 2557,2572 ----
+ Escape {string} for use as file name command argument. All
+ characters that have a special meaning, such as '%' and '|'
+ are escaped with a backslash.
+! 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'
+ :exe "edit " . fnameescape(fname)
+ < results in executing: >
+! edit \+some\ str\%nge\|name
+
+ fnamemodify({fname}, {mods}) *fnamemodify()*
+ Modify file name {fname} according to {mods}. {mods} is a
+*** ../vim-7.2c.001/src/ex_getln.c Wed Aug 6 15:02:43 2008
+--- src/ex_getln.c Fri Aug 8 11:31:33 2008
+***************
+*** 3666,3672 ****
+ if ((*p != '[' && *p != '{') || !vim_isfilec(*p))
+ buf[j++] = *p;
+ buf[j] = NUL;
+! return 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)
+--- 3666,3672 ----
+ if ((*p != '[' && *p != '{') || !vim_isfilec(*p))
+ buf[j++] = *p;
+ buf[j] = NUL;
+! 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)
+***************
+*** 3679,3686 ****
+ vim_free(p);
+ p = s;
+ }
+- return p;
+ #endif
+ }
+
+ /*
+--- 3679,3692 ----
+ vim_free(p);
+ p = s;
+ }
+ #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;
+ }
+
+ /*
+*** ../vim-7.2c.001/src/version.c Fri Aug 8 12:35:03 2008
+--- src/version.c Fri Aug 8 12:56:06 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 2,
+ /**/
+
+--
+Permission is granted to read this message out aloud on Kings Cross Road,
+London, under the condition that the orator is properly dressed.
+
+ /// Bram Moolenaar -- Bram at Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
Vim packaging
More information about the pkg-vim-maintainers
mailing list