git-imap-send: simplify tunnel construction

Signed-off-by: Bernhard Reiter <ockham@raz.or.at> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Bernhard Reiter committed Aug 13, 2014 at 19:30 UTC f9dc5d65ca31cb79893e1296efe37727bf58f3f3
1 file changed +2 -3
imap-send.c
+2 -3
@@ -961,17 +961,16 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc)
961 /* open connection to IMAP server */
962
963 if (srvc->tunnel) {
964 - const char *argv[] = { srvc->tunnel, NULL };
964 struct child_process tunnel = {NULL};
965
966 imap_info("Starting tunnel '%s'... ", srvc->tunnel);
967
969 - tunnel.argv = argv;
968 + argv_array_push(&tunnel.args, srvc->tunnel);
969 tunnel.use_shell = 1;
970 tunnel.in = -1;
971 tunnel.out = -1;
972 if (start_command(&tunnel))
974 - die("cannot start proxy %s", argv[0]);
973 + die("cannot start proxy %s", srvc->tunnel);
974
975 imap->buf.sock.fd[0] = tunnel.out;
976 imap->buf.sock.fd[1] = tunnel.in;