149 |
memset(args, 0, LINEBUFFER + 1); |
memset(args, 0, LINEBUFFER + 1); |
150 |
pargs = exec_args; |
pargs = exec_args; |
151 |
pargs++; |
pargs++; |
152 |
while (*pargs) |
while (*pargs) { |
|
{ |
|
153 |
strncat(args, *pargs, LINEBUFFER - strlen(args)); |
strncat(args, *pargs, LINEBUFFER - strlen(args)); |
154 |
strncat(args, " ", LINEBUFFER - strlen(args)); |
strncat(args, " ", LINEBUFFER - strlen(args)); |
155 |
pargs++; |
pargs++; |
218 |
} |
} |
219 |
|
|
220 |
args = gen_execargs(a); |
args = gen_execargs(a); |
221 |
ret = exec_argv(rs, args, src, dst, dstsize); |
ret = exec_argv(rs, p, args, src, dst, dstsize); |
222 |
xfree_pptr(args); |
xfree_pptr(args); |
223 |
return ret; |
return ret; |
224 |
} |
} |
225 |
|
|
226 |
char * |
char * |
227 |
exec_argv(int *rs, char **argv, char *src, char *dst, int dstsize) |
exec_argv(int *rs, char *path, char **argv, char *src, char *dst, int dstsize) |
228 |
{ |
{ |
229 |
int status; |
int status; |
230 |
int fd; |
int fd; |
231 |
int n; |
int n; |
232 |
char *buf; |
char *buf; |
233 |
|
|
234 |
fd = make_local_connection(argv[0], argv); |
fd = make_local_connection(path ? path : argv[0], argv); |
235 |
if (fd == -1) { |
if (fd == -1) { |
236 |
*rs = -1; |
*rs = -1; |
237 |
return 0; |
return 0; |