File tree Expand file tree Collapse file tree 4 files changed +10
-12
lines changed Expand file tree Collapse file tree 4 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -249,10 +249,11 @@ static int filter_buffer(int fd, void *data)
249
249
struct child_process child_process ;
250
250
struct filter_params * params = (struct filter_params * )data ;
251
251
int write_err , status ;
252
- const char * argv [] = { "sh" , "-c" , params -> cmd , NULL };
252
+ const char * argv [] = { params -> cmd , NULL };
253
253
254
254
memset (& child_process , 0 , sizeof (child_process ));
255
255
child_process .argv = argv ;
256
+ child_process .use_shell = 1 ;
256
257
child_process .in = -1 ;
257
258
child_process .out = fd ;
258
259
Original file line number Diff line number Diff line change @@ -965,17 +965,13 @@ static struct store *imap_open_store(struct imap_server_conf *srvc)
965
965
/* open connection to IMAP server */
966
966
967
967
if (srvc -> tunnel ) {
968
- const char * argv [4 ] ;
968
+ const char * argv [] = { srvc -> tunnel , NULL } ;
969
969
struct child_process tunnel = {0 };
970
970
971
971
imap_info ("Starting tunnel '%s'... " , srvc -> tunnel );
972
972
973
- argv [0 ] = "sh" ;
974
- argv [1 ] = "-c" ;
975
- argv [2 ] = srvc -> tunnel ;
976
- argv [3 ] = NULL ;
977
-
978
973
tunnel .argv = argv ;
974
+ tunnel .use_shell = 1 ;
979
975
tunnel .in = -1 ;
980
976
tunnel .out = -1 ;
981
977
if (start_command (& tunnel ))
Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ static int ll_ext_merge(const struct ll_merge_driver *fn,
175
175
{ "B" , temp [2 ] },
176
176
{ NULL }
177
177
};
178
- const char * args [] = { "sh" , "-c" , NULL , NULL };
178
+ const char * args [] = { NULL , NULL };
179
179
int status , fd , i ;
180
180
struct stat st ;
181
181
@@ -190,8 +190,8 @@ static int ll_ext_merge(const struct ll_merge_driver *fn,
190
190
191
191
strbuf_expand (& cmd , fn -> cmdline , strbuf_expand_dict_cb , & dict );
192
192
193
- args [2 ] = cmd .buf ;
194
- status = run_command_v_opt (args , 0 );
193
+ args [0 ] = cmd .buf ;
194
+ status = run_command_v_opt (args , RUN_USING_SHELL );
195
195
fd = open (temp [1 ], O_RDONLY );
196
196
if (fd < 0 )
197
197
goto bad ;
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ static void pager_preexec(void)
28
28
}
29
29
#endif
30
30
31
- static const char * pager_argv [] = { "sh" , "-c" , NULL , NULL };
31
+ static const char * pager_argv [] = { NULL , NULL };
32
32
static struct child_process pager_process ;
33
33
34
34
static void wait_for_pager (void )
@@ -81,7 +81,8 @@ void setup_pager(void)
81
81
spawned_pager = 1 ; /* means we are emitting to terminal */
82
82
83
83
/* spawn the pager */
84
- pager_argv [2 ] = pager ;
84
+ pager_argv [0 ] = pager ;
85
+ pager_process .use_shell = 1 ;
85
86
pager_process .argv = pager_argv ;
86
87
pager_process .in = -1 ;
87
88
if (!getenv ("LESS" )) {
You can’t perform that action at this time.
0 commit comments