diff options
author | Karel Kočí <cynerd@email.cz> | 2019-04-28 15:17:38 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2019-04-28 15:17:38 +0200 |
commit | 3f0fa5587f6e69e8957e674d3ccde6ff8873302e (patch) | |
tree | 7eea6858f33fca7b47eb783f79caa14b85c2ebc7 /child.c | |
parent | e05d7a634692fd575189995f72c70420a4b220cb (diff) | |
download | uroot-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.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -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; |