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 vim/vim#1543)

1ef73e33c9
This commit is contained in:
Justin M. Keyes
2018-01-21 10:28:52 +01:00
parent ce09d4134b
commit 456cf72974
2 changed files with 15 additions and 4 deletions

View File

@@ -925,7 +925,7 @@ void ex_diffpatch(exarg_T *eap)
} else {
// Build the patch command and execute it. Ignore errors.
#ifdef UNIX
vim_snprintf((char *)buf, buflen, "patch -o %s %s < \"%s\"",
vim_snprintf((char *)buf, buflen, "patch -o %s %s < '%s'",
tmp_new, tmp_orig, fullname != NULL ? fullname : eap->arg);
#else
vim_snprintf((char *)buf, buflen, "patch -o %s %s < \"%s\"",