aboutsummaryrefslogtreecommitdiff
path: root/child.c
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2019-04-28 15:17:38 +0200
committerKarel Kočí <cynerd@email.cz>2019-04-28 15:17:38 +0200
commit3f0fa5587f6e69e8957e674d3ccde6ff8873302e (patch)
tree7eea6858f33fca7b47eb783f79caa14b85c2ebc7 /child.c
parente05d7a634692fd575189995f72c70420a4b220cb (diff)
downloaduroot-3f0fa5587f6e69e8957e674d3ccde6ff8873302e.tar.gz
uroot-3f0fa5587f6e69e8957e674d3ccde6ff8873302e.tar.bz2
uroot-3f0fa5587f6e69e8957e674d3ccde6ff8873302e.zip
Add argument parser
This implements argument parser based on glibc argp.
Diffstat (limited to 'child.c')
-rw-r--r--child.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/child.c b/child.c
index d0e09a8..a9c5c26 100644
--- a/child.c
+++ b/child.c
@@ -50,10 +50,7 @@ int child_main(void *_args) {
const char *shell = get_shell();
execl(shell, shell, NULL);
} else {
- char *new_argv[args->argc + 1];
- memcpy(new_argv, args->argv + 1, args->argc * sizeof *new_argv);
- new_argv[args->argc] = NULL;
- execvp(new_argv[0], new_argv);
+ execvp(args->argv[0], args->argv);
assert_perror(errno);
}
return 1;