aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-03-29 22:33:53 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-03-31 08:07:47 -0300
commitab61c2caa71d952d52ebede8b0f4532542251edb (patch)
treee1ce2e0af65b05e858d4ed9ab8ca209fc2315d33 /src/os_unix.c
parent206a38871f8249da308191f5d84b17a97e64b92e (diff)
downloadrneovim-ab61c2caa71d952d52ebede8b0f4532542251edb.tar.gz
rneovim-ab61c2caa71d952d52ebede8b0f4532542251edb.tar.bz2
rneovim-ab61c2caa71d952d52ebede8b0f4532542251edb.zip
Rewrite `show_shell_mess` as a `ShellOpts` flag
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 0a6a8a2794..18d724a629 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 int show_shell_mess = TRUE;
/* volatile because it is used in signal handler deathtrap(). */
static volatile int deadly_signal = 0; /* The signal we caught */
@@ -1754,7 +1753,7 @@ int mch_call_shell(char_u *cmd, ShellOpts opts, char_u *extra_shell_arg)
} else if (pid == 0) { /* child */
reset_signals(); /* handle signals normally */
- if (!show_shell_mess || (opts & kShellOptExpand)) {
+ if (opts & (kShellOptHideMess | kShellOptExpand)) {
int fd;
/*
@@ -2459,6 +2458,7 @@ int flags; /* EW_* flags */
char_u *p;
int dir;
char_u *extra_shell_arg = NULL;
+ ShellOpts shellopts = kShellOptExpand | kShellOptSilent;
/*
* This is the non-OS/2 implementation (really Unix).
*/
@@ -2635,8 +2635,11 @@ int flags; /* EW_* flags */
}
*p = NUL;
}
- if (flags & EW_SILENT)
- show_shell_mess = FALSE;
+
+ if (flags & EW_SILENT) {
+ shellopts |= kShellOptHideMess;
+ }
+
if (ampersent)
STRCAT(command, "&"); /* put the '&' after the redirection */
@@ -2661,7 +2664,7 @@ int flags; /* EW_* flags */
*/
i = call_shell(
command,
- kShellOptExpand | kShellOptSilent,
+ shellopts,
extra_shell_arg
);
@@ -2670,7 +2673,6 @@ int flags; /* EW_* flags */
if (ampersent)
os_delay(10L, TRUE);
- show_shell_mess = TRUE;
vim_free(command);
if (i != 0) { /* mch_call_shell() failed */