summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenys Vlasenko2009-08-17 02:12:20 +0200
committerDenys Vlasenko2009-08-17 02:12:20 +0200
commitffc39202aad7858bbe4a894f0e81e7ec313b5478 (patch)
treecc12147d1f7145afea6c95a2f6211a301e1f58a4 /shell
parentf210cff601cf034c522b41cae6acd4f56060126d (diff)
downloadbusybox-ffc39202aad7858bbe4a894f0e81e7ec313b5478.zip
busybox-ffc39202aad7858bbe4a894f0e81e7ec313b5478.tar.gz
ash: fix bug 571 (jobs %string misbehaving)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 3755202..077f5e5 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -3510,7 +3510,7 @@ getjob(const char *name, int getctl)
{
struct job *jp;
struct job *found;
- const char *err_msg = "No such job: %s";
+ const char *err_msg = "%s: no such job";
unsigned num;
int c;
const char *p;
@@ -3562,10 +3562,8 @@ getjob(const char *name, int getctl)
p++;
}
- found = 0;
- while (1) {
- if (!jp)
- goto err;
+ found = NULL;
+ while (jp) {
if (match(jp->ps[0].cmd, p)) {
if (found)
goto err;
@@ -3574,6 +3572,9 @@ getjob(const char *name, int getctl)
}
jp = jp->prev_job;
}
+ if (!found)
+ goto err;
+ jp = found;
gotit:
#if JOBS