mirror of
https://github.com/sheumann/hush.git
synced 2024-12-22 14:30:31 +00:00
ash: fix bug 571 (jobs %string misbehaving)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
f210cff601
commit
ffc39202aa
11
shell/ash.c
11
shell/ash.c
@ -3510,7 +3510,7 @@ getjob(const char *name, int getctl)
|
|||||||
{
|
{
|
||||||
struct job *jp;
|
struct job *jp;
|
||||||
struct job *found;
|
struct job *found;
|
||||||
const char *err_msg = "No such job: %s";
|
const char *err_msg = "%s: no such job";
|
||||||
unsigned num;
|
unsigned num;
|
||||||
int c;
|
int c;
|
||||||
const char *p;
|
const char *p;
|
||||||
@ -3562,10 +3562,8 @@ getjob(const char *name, int getctl)
|
|||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
|
|
||||||
found = 0;
|
found = NULL;
|
||||||
while (1) {
|
while (jp) {
|
||||||
if (!jp)
|
|
||||||
goto err;
|
|
||||||
if (match(jp->ps[0].cmd, p)) {
|
if (match(jp->ps[0].cmd, p)) {
|
||||||
if (found)
|
if (found)
|
||||||
goto err;
|
goto err;
|
||||||
@ -3574,6 +3572,9 @@ getjob(const char *name, int getctl)
|
|||||||
}
|
}
|
||||||
jp = jp->prev_job;
|
jp = jp->prev_job;
|
||||||
}
|
}
|
||||||
|
if (!found)
|
||||||
|
goto err;
|
||||||
|
jp = found;
|
||||||
|
|
||||||
gotit:
|
gotit:
|
||||||
#if JOBS
|
#if JOBS
|
||||||
|
Loading…
Reference in New Issue
Block a user