patch 9.0.0743: starting cscope on Unix does not quote the arguments right
Problem: Starting cscope on Unix does not quote the arguments correctly.
(Gary Johnson)
Solution: Move the final quote after the arguments.
diff --git a/src/if_cscope.c b/src/if_cscope.c
index 8094750..3252ff4 100644
--- a/src/if_cscope.c
+++ b/src/if_cscope.c
@@ -954,7 +954,7 @@
// run the cscope command
#ifdef UNIX
- vim_snprintf(cmd, cmdlen, "/bin/sh -c \"exec %s -dl -f %s\"",
+ vim_snprintf(cmd, cmdlen, "/bin/sh -c \"exec %s -dl -f %s",
prog, csinfo[i].fname);
#else
vim_snprintf(cmd, cmdlen, "%s -dl -f %s", prog, csinfo[i].fname);
@@ -970,6 +970,9 @@
vim_snprintf(cmd + len, cmdlen - len, " %s", csinfo[i].flags);
}
# ifdef UNIX
+ // terminate the -c command argument
+ STRCAT(cmd, "\"");
+
// on Win32 we still need prog
vim_free(prog);
# endif