From 456cf72974865cecf489bc5a5b4003c22745a77d Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 21 Jan 2018 10:28:52 +0100 Subject: 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) https://github.com/vim/vim/commit/1ef73e33c9414eb02c229d8234aafd9d481a8856 --- src/nvim/diff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/diff.c') diff --git a/src/nvim/diff.c b/src/nvim/diff.c index dd489c18e9..4db81a97a2 100644 --- a/src/nvim/diff.c +++ b/src/nvim/diff.c @@ -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\"", -- cgit