aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-08-17 02:12:20 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-08-17 02:12:20 +0200
commitffc39202aad7858bbe4a894f0e81e7ec313b5478 (patch)
treecc12147d1f7145afea6c95a2f6211a301e1f58a4
parentf210cff601cf034c522b41cae6acd4f56060126d (diff)
downloadbusybox-w32-ffc39202aad7858bbe4a894f0e81e7ec313b5478.tar.gz
busybox-w32-ffc39202aad7858bbe4a894f0e81e7ec313b5478.tar.bz2
busybox-w32-ffc39202aad7858bbe4a894f0e81e7ec313b5478.zip
ash: fix bug 571 (jobs %string misbehaving)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-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