summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fa7151a)
raw | patch | inline | side by side (parent: fa7151a)
author | Jeff King <peff@peff.net> | |
Wed, 30 Dec 2009 10:53:57 +0000 (05:53 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 6 Jan 2010 07:41:50 +0000 (23:41 -0800) |
Now that we have the use_shell feature, these callsites can
all be converted with small changes.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
all be converted with small changes.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
convert.c | patch | blob | history | |
imap-send.c | patch | blob | history | |
ll-merge.c | patch | blob | history | |
pager.c | patch | blob | history |
diff --git a/convert.c b/convert.c
index 491e7141b4ea29b3cf754cbaf2656a0c3ca8c46c..950b1f9840663e7536256babb05f68de01a4689b 100644 (file)
--- a/convert.c
+++ b/convert.c
struct child_process child_process;
struct filter_params *params = (struct filter_params *)data;
int write_err, status;
- const char *argv[] = { "sh", "-c", params->cmd, NULL };
+ const char *argv[] = { params->cmd, NULL };
memset(&child_process, 0, sizeof(child_process));
child_process.argv = argv;
+ child_process.use_shell = 1;
child_process.in = -1;
child_process.out = fd;
diff --git a/imap-send.c b/imap-send.c
index de8114bac010ef095cf9de17671566e248366dcb..51f371ba9f08637657ec9198cf3f16d0c0407232 100644 (file)
--- a/imap-send.c
+++ b/imap-send.c
/* open connection to IMAP server */
if (srvc->tunnel) {
- const char *argv[4];
+ const char *argv[] = { srvc->tunnel, NULL };
struct child_process tunnel = {0};
imap_info("Starting tunnel '%s'... ", srvc->tunnel);
- argv[0] = "sh";
- argv[1] = "-c";
- argv[2] = srvc->tunnel;
- argv[3] = NULL;
-
tunnel.argv = argv;
+ tunnel.use_shell = 1;
tunnel.in = -1;
tunnel.out = -1;
if (start_command(&tunnel))
diff --git a/ll-merge.c b/ll-merge.c
index 2d6b6d6cb1d2bc2d334bf058feb3444e94b5a781..18511e281fe7435c2ae93ba3faf502cc606e62b9 100644 (file)
--- a/ll-merge.c
+++ b/ll-merge.c
{ "B", temp[2] },
{ NULL }
};
- const char *args[] = { "sh", "-c", NULL, NULL };
+ const char *args[] = { NULL, NULL };
int status, fd, i;
struct stat st;
strbuf_expand(&cmd, fn->cmdline, strbuf_expand_dict_cb, &dict);
- args[2] = cmd.buf;
- status = run_command_v_opt(args, 0);
+ args[0] = cmd.buf;
+ status = run_command_v_opt(args, RUN_USING_SHELL);
fd = open(temp[1], O_RDONLY);
if (fd < 0)
goto bad;
index 92c03f654abd0333bd0dd48b4aebf9ae42ac4de5..2c7e8ecb3c0860b00113e348008415ca28a7ff72 100644 (file)
--- a/pager.c
+++ b/pager.c
}
#endif
-static const char *pager_argv[] = { "sh", "-c", NULL, NULL };
+static const char *pager_argv[] = { NULL, NULL };
static struct child_process pager_process;
static void wait_for_pager(void)
spawned_pager = 1; /* means we are emitting to terminal */
/* spawn the pager */
- pager_argv[2] = pager;
+ pager_argv[0] = pager;
+ pager_process.use_shell = 1;
pager_process.argv = pager_argv;
pager_process.in = -1;
if (!getenv("LESS")) {