diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-09-11 03:27:35 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-09-11 03:27:35 +0200 |
commit | ca65514a241b239e656cb87f0912bd9ba2e18ad8 (patch) | |
tree | 104596d8b46c823969085c4ebf8a39dd12982646 /src/nvim/misc2.c | |
parent | 8dc6c1a7ff97700a0622497245f2d5d257e1dfdb (diff) | |
parent | 395ef5642e6e61d8f59d1ef67dd7d203b9bb72e6 (diff) | |
download | rneovim-ca65514a241b239e656cb87f0912bd9ba2e18ad8.tar.gz rneovim-ca65514a241b239e656cb87f0912bd9ba2e18ad8.tar.bz2 rneovim-ca65514a241b239e656cb87f0912bd9ba2e18ad8.zip |
Merge #2789 'system(): Respect shellxescape, shellxquote'
Diffstat (limited to 'src/nvim/misc2.c')
-rw-r--r-- | src/nvim/misc2.c | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/src/nvim/misc2.c b/src/nvim/misc2.c index 368f83cfb5..8b4d8c7c3e 100644 --- a/src/nvim/misc2.c +++ b/src/nvim/misc2.c @@ -281,7 +281,6 @@ int default_fileformat(void) // Call shell. Calls os_call_shell, with 'shellxquote' added. int call_shell(char_u *cmd, ShellOpts opts, char_u *extra_shell_arg) { - char_u *ncmd; int retval; proftime_T wait_time; @@ -303,28 +302,7 @@ int call_shell(char_u *cmd, ShellOpts opts, char_u *extra_shell_arg) /* The external command may update a tags file, clear cached tags. */ tag_freematch(); - if (cmd == NULL || *p_sxq == NUL) - retval = os_call_shell(cmd, opts, extra_shell_arg); - else { - char_u *ecmd = cmd; - - if (*p_sxe != NUL && STRCMP(p_sxq, "(") == 0) { - ecmd = vim_strsave_escaped_ext(cmd, p_sxe, '^', FALSE); - } - ncmd = xmalloc(STRLEN(ecmd) + STRLEN(p_sxq) * 2 + 1); - STRCPY(ncmd, p_sxq); - STRCAT(ncmd, ecmd); - /* When 'shellxquote' is ( append ). - * When 'shellxquote' is "( append )". */ - STRCAT(ncmd, STRCMP(p_sxq, "(") == 0 ? (char_u *)")" - : STRCMP(p_sxq, "\"(") == 0 ? (char_u *)")\"" - : p_sxq); - retval = os_call_shell(ncmd, opts, extra_shell_arg); - xfree(ncmd); - - if (ecmd != cmd) - xfree(ecmd); - } + retval = os_call_shell(cmd, opts, extra_shell_arg); } set_vim_var_nr(VV_SHELL_ERROR, (varnumber_T) retval); |