1
0
forked from aniani/vim

patch 8.0.0442: patch shell command not well escaped

Problem:    Patch shell command uses double quotes around the argument, which
            allows for $HOME to be expanded. (Etienne)
Solution:   Use single quotes on Unix. (closes #1543)
This commit is contained in:
Bram Moolenaar
2017-03-09 19:21:30 +01:00
parent ad2cfb54b7
commit 1ef73e33c9
3 changed files with 22 additions and 4 deletions

View File

@@ -977,7 +977,12 @@ ex_diffpatch(exarg_T *eap)
{
/* Build the patch command and execute it. Ignore errors. Switch to
* cooked mode to allow the user to respond to prompts. */
vim_snprintf((char *)buf, buflen, "patch -o %s %s < \"%s\"",
vim_snprintf((char *)buf, buflen,
#ifdef UNIX
"patch -o %s %s < '%s'",
#else
"patch -o %s %s < \"%s\"",
#endif
tmp_new, tmp_orig,
# ifdef UNIX
fullname != NULL ? fullname :