aboutsummaryrefslogtreecommitdiff
path: root/child.c
diff options
context:
space:
mode:
Diffstat (limited to 'child.c')
-rw-r--r--child.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/child.c b/child.c
index d25df85..67eeeb2 100644
--- a/child.c
+++ b/child.c
@@ -49,12 +49,12 @@ int child_main(void *_args) {
assert_perror(errno);
}
- if (args->argc <= 1) {
- const char *shell = get_shell();
- execl(shell, shell, NULL);
- } else {
+ if (args->argc > 0) {
execvp(args->argv[0], args->argv);
assert_perror(errno);
+ } else {
+ const char *shell = get_shell();
+ execl(shell, shell, NULL);
}
return 1;
}