aboutsummaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-02-21 01:26:42 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-02-21 01:26:42 +0100
commit7426920461738367205e3d08649c827c747bd93d (patch)
tree8e5b59c8ecb5c0bd365c6cfaba3250089cce45de /shell/ash.c
parent00ddd44cdad8142c6bb836efbfde9f38fa31b899 (diff)
downloadbusybox-7426920461738367205e3d08649c827c747bd93d.tar.gz
fix bug 1087. Fix by Leonid (lly.dev AT gmail.com)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 798d15a4c..7f14bedb5 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -4539,7 +4539,7 @@ forkchild(struct job *jp, union node *n, int mode)
if (mode == FORK_NOJOB /* is it `xxx` ? */
&& n && n->type == NCMD /* is it single cmd? */
/* && n->ncmd.args->type == NARG - always true? */
- && strcmp(n->ncmd.args->narg.text, "trap") == 0
+ && n->ncmd.args && strcmp(n->ncmd.args->narg.text, "trap") == 0
&& n->ncmd.args->narg.next == NULL /* "trap" with no arguments */
/* && n->ncmd.args->narg.backquote == NULL - do we need to check this? */
) {
@@ -4627,7 +4627,7 @@ forkchild(struct job *jp, union node *n, int mode)
}
#if JOBS
if (n && n->type == NCMD
- && strcmp(n->ncmd.args->narg.text, "jobs") == 0
+ && n->ncmd.args && strcmp(n->ncmd.args->narg.text, "jobs") == 0
) {
TRACE(("Job hack\n"));
/* "jobs": we do not want to clear job list for it,