diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c --- a/bin/sh/jobs.c +++ b/bin/sh/jobs.c @@ -587,6 +587,8 @@ return retval; } } else { + if (njobs == 0) + return 0; for (jp = jobtab ; jp < jobtab + njobs; jp++) if (jp->used && jp->state == JOBDONE) { if (! iflag || ! jp->changed)