aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-03-29 12:53:11 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-03-31 08:07:46 -0300
commitc7919222249812947daa04d6d266b6aa561e5ef3 (patch)
tree4e38df95fca8dbd3a8a18fc722ffa8c32a7f027f /src
parent8a61c27b1e301bb342758434f23bd7828790dcdf (diff)
downloadrneovim-c7919222249812947daa04d6d266b6aa561e5ef3.tar.gz
rneovim-c7919222249812947daa04d6d266b6aa561e5ef3.tar.bz2
rneovim-c7919222249812947daa04d6d266b6aa561e5ef3.zip
Make `extra_shell_arg` a `mch_call_shell` parameter
Diffstat (limited to 'src')
-rw-r--r--src/diff.c4
-rw-r--r--src/ex_cmds.c4
-rw-r--r--src/misc1.c2
-rw-r--r--src/misc2.c6
-rw-r--r--src/misc2.h2
-rw-r--r--src/os/shell.c2
-rw-r--r--src/os_unix.c9
-rw-r--r--src/os_unix.h2
8 files changed, 15 insertions, 16 deletions
diff --git a/src/diff.c b/src/diff.c
index 6786a964ff..af40b1295a 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -840,7 +840,7 @@ static void diff_file(char_u *tmp_orig, char_u *tmp_new, char_u *tmp_diff)
tmp_orig, tmp_new);
append_redir(cmd, (int)len, p_srr, tmp_diff);
block_autocmds(); /* Avoid ShellCmdPost stuff */
- (void)call_shell(cmd, SHELL_FILTER | SHELL_SILENT | SHELL_DOOUT);
+ (void)call_shell(cmd, SHELL_FILTER | SHELL_SILENT | SHELL_DOOUT, NULL);
unblock_autocmds();
vim_free(cmd);
}
@@ -943,7 +943,7 @@ void ex_diffpatch(exarg_T *eap)
#endif // ifdef UNIX
// Avoid ShellCmdPost stuff
block_autocmds();
- (void)call_shell(buf, SHELL_FILTER | SHELL_COOKED);
+ (void)call_shell(buf, SHELL_FILTER | SHELL_COOKED, NULL);
unblock_autocmds();
}
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index cb4c24737b..335425b919 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -1102,7 +1102,7 @@ do_filter (
* like ":r !cat" hangs.
* Pass on the SHELL_DOOUT flag when the output is being redirected.
*/
- if (call_shell(cmd_buf, SHELL_FILTER | SHELL_COOKED | shell_flags)) {
+ if (call_shell(cmd_buf, SHELL_FILTER | SHELL_COOKED | shell_flags, NULL)) {
redraw_later_clear();
wait_return(FALSE);
}
@@ -1256,7 +1256,7 @@ do_shell (
if (!swapping_screen())
windgoto(msg_row, msg_col);
cursor_on();
- (void)call_shell(cmd, SHELL_COOKED | flags);
+ (void)call_shell(cmd, SHELL_COOKED | flags, NULL);
did_check_timestamps = FALSE;
need_check_timestamps = TRUE;
diff --git a/src/misc1.c b/src/misc1.c
index 5e80e129d7..8b96bb2235 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -3670,7 +3670,7 @@ get_cmd_output (
* Don't check timestamps here.
*/
++no_check_timestamps;
- call_shell(command, SHELL_DOOUT | SHELL_EXPAND | flags);
+ call_shell(command, SHELL_DOOUT | SHELL_EXPAND | flags, NULL);
--no_check_timestamps;
vim_free(command);
diff --git a/src/misc2.c b/src/misc2.c
index 3218de2156..f2269e7aae 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -1531,7 +1531,7 @@ int default_fileformat(void)
/*
* Call shell. Calls mch_call_shell, with 'shellxquote' added.
*/
-int call_shell(char_u *cmd, int opt)
+int call_shell(char_u *cmd, int opt, char_u *extra_shell_arg)
{
char_u *ncmd;
int retval;
@@ -1557,7 +1557,7 @@ int call_shell(char_u *cmd, int opt)
tag_freematch();
if (cmd == NULL || *p_sxq == NUL)
- retval = mch_call_shell(cmd, opt);
+ retval = mch_call_shell(cmd, opt, extra_shell_arg);
else {
char_u *ecmd = cmd;
@@ -1575,7 +1575,7 @@ int call_shell(char_u *cmd, int opt)
STRCAT(ncmd, STRCMP(p_sxq, "(") == 0 ? (char_u *)")"
: STRCMP(p_sxq, "\"(") == 0 ? (char_u *)")\""
: p_sxq);
- retval = mch_call_shell(ncmd, opt);
+ retval = mch_call_shell(ncmd, opt, extra_shell_arg);
vim_free(ncmd);
} else
retval = -1;
diff --git a/src/misc2.h b/src/misc2.h
index ddf71b3ac1..425e838486 100644
--- a/src/misc2.h
+++ b/src/misc2.h
@@ -64,7 +64,7 @@ int get_fileformat(buf_T *buf);
int get_fileformat_force(buf_T *buf, exarg_T *eap);
void set_fileformat(int t, int opt_flags);
int default_fileformat(void);
-int call_shell(char_u *cmd, int opt);
+int call_shell(char_u *cmd, int opt, char_u *extra_shell_arg);
int get_real_state(void);
int after_pathsep(char_u *b, char_u *p);
int same_directory(char_u *f1, char_u *f2);
diff --git a/src/os/shell.c b/src/os/shell.c
index 51e6d65b5b..cbedf72a9c 100644
--- a/src/os/shell.c
+++ b/src/os/shell.c
@@ -53,3 +53,5 @@ int shell_count_argc(char_u **ptr)
return rv;
}
+
+char ** shell_build_argv(char_u **ptr, int argc);
diff --git a/src/os_unix.c b/src/os_unix.c
index 7a3124130f..d53ddac830 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -143,7 +143,6 @@ static int save_patterns(int num_pat, char_u **pat, int *num_file,
/* volatile because it is used in signal handler sig_winch(). */
static volatile int do_resize = FALSE;
-static char_u *extra_shell_arg = NULL;
static int show_shell_mess = TRUE;
/* volatile because it is used in signal handler deathtrap(). */
static volatile int deadly_signal = 0; /* The signal we caught */
@@ -1682,9 +1681,7 @@ waitstatus *status;
return wait_pid;
}
-int mch_call_shell(cmd, options)
-char_u *cmd;
-int options; /* SHELL_*, see vim.h */
+int mch_call_shell(char_u *cmd, int options, char_u *extra_shell_arg)
{
int tmode = cur_tmode;
@@ -2515,6 +2512,7 @@ int flags; /* EW_* flags */
size_t len;
char_u *p;
int dir;
+ char_u *extra_shell_arg = NULL;
/*
* This is the non-OS/2 implementation (really Unix).
*/
@@ -2715,14 +2713,13 @@ int flags; /* EW_* flags */
/*
* execute the shell command
*/
- i = call_shell(command, SHELL_EXPAND | SHELL_SILENT);
+ i = call_shell(command, SHELL_EXPAND | SHELL_SILENT, extra_shell_arg);
/* When running in the background, give it some time to create the temp
* file, but don't wait for it to finish. */
if (ampersent)
os_delay(10L, TRUE);
- extra_shell_arg = NULL; /* cleanup */
show_shell_mess = TRUE;
vim_free(command);
diff --git a/src/os_unix.h b/src/os_unix.h
index ad7fa85ccb..48ce4f8e87 100644
--- a/src/os_unix.h
+++ b/src/os_unix.h
@@ -42,7 +42,7 @@ int mch_screenmode(char_u *arg);
int mch_get_shellsize(void);
void mch_set_shellsize(void);
void mch_new_shellsize(void);
-int mch_call_shell(char_u *cmd, int options);
+int mch_call_shell(char_u *cmd, int options, char_u *extra_shell_arg);
int mch_expandpath(garray_T *gap, char_u *path, int flags);
int mch_expand_wildcards(int num_pat, char_u **pat, int *num_file,
char_u ***file,