aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/ash.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 3755202eb..077f5e5fc 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -3510,7 +3510,7 @@ getjob(const char *name, int getctl)
3510{ 3510{
3511 struct job *jp; 3511 struct job *jp;
3512 struct job *found; 3512 struct job *found;
3513 const char *err_msg = "No such job: %s"; 3513 const char *err_msg = "%s: no such job";
3514 unsigned num; 3514 unsigned num;
3515 int c; 3515 int c;
3516 const char *p; 3516 const char *p;
@@ -3562,10 +3562,8 @@ getjob(const char *name, int getctl)
3562 p++; 3562 p++;
3563 } 3563 }
3564 3564
3565 found = 0; 3565 found = NULL;
3566 while (1) { 3566 while (jp) {
3567 if (!jp)
3568 goto err;
3569 if (match(jp->ps[0].cmd, p)) { 3567 if (match(jp->ps[0].cmd, p)) {
3570 if (found) 3568 if (found)
3571 goto err; 3569 goto err;
@@ -3574,6 +3572,9 @@ getjob(const char *name, int getctl)
3574 } 3572 }
3575 jp = jp->prev_job; 3573 jp = jp->prev_job;
3576 } 3574 }
3575 if (!found)
3576 goto err;
3577 jp = found;
3577 3578
3578 gotit: 3579 gotit:
3579#if JOBS 3580#if JOBS