fix bug 1087. Fix by Leonid (lly.dev AT gmail.com)

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2010-02-21 01:26:42 +01:00
parent 00ddd44cda
commit 7426920461
3 changed files with 8 additions and 2 deletions

View File

@ -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,

View File

@ -0,0 +1,3 @@
Test 1
Test 2
Done

View File

@ -0,0 +1,3 @@
echo Test ` ` 1
echo Test `</dev/null` 2
echo Done