From 495f177f3aa8922073abf86ba1913119e180054f Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Mon, 15 Aug 2005 03:28:39 +0000 Subject: 21366: LONG_LIST_JOBS applies to more places where job listings are printed --- Src/jobs.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'Src/jobs.c') diff --git a/Src/jobs.c b/Src/jobs.c index a22a8a6a8..9d7d2aace 100644 --- a/Src/jobs.c +++ b/Src/jobs.c @@ -811,7 +811,7 @@ printjob(Job jn, int lng, int synch) if (lng < 0) { conted = 1; - lng = 0; + lng = !!isset(LONGLISTJOBS); } /* find length of longest signame, check to see */ @@ -871,7 +871,7 @@ printjob(Job jn, int lng, int synch) break; len2 += strlen(qn->text) + 2; } - if (!thisfmt) { + if (!thisfmt || lng) { if (fline) fprintf(fout, "[%ld] %c ", (long)job, @@ -1337,7 +1337,7 @@ scanjobs(void) for (i = 1; i <= maxjob; i++) if (jobtab[i].stat & STAT_CHANGED) - printjob(jobtab + i, 0, 1); + printjob(jobtab + i, !!isset(LONGLISTJOBS), 1); } /**** job control builtins ****/ @@ -1605,10 +1605,14 @@ bin_fg(char *name, char **argv, Options ops, int func) return 0; } - lng = (OPT_ISSET(ops,'l')) ? 1 : (OPT_ISSET(ops,'p')) ? 2 : 0; - if (OPT_ISSET(ops,'d')) - lng |= 4; - + if (func == BIN_JOBS) { + lng = (OPT_ISSET(ops,'l')) ? 1 : (OPT_ISSET(ops,'p')) ? 2 : 0; + if (OPT_ISSET(ops,'d')) + lng |= 4; + } else { + lng = !!isset(LONGLISTJOBS); + } + if ((func == BIN_FG || func == BIN_BG) && !jobbing) { /* oops... maybe bg and fg should have been disabled? */ zwarnnam(name, "no job control in this shell.", NULL, 0); @@ -1745,7 +1749,7 @@ bin_fg(char *name, char **argv, Options ops, int func) } if (func != BIN_WAIT) /* for bg and fg -- show the job we are operating on */ - printjob(jobtab + job, (stopped) ? -1 : 0, 1); + printjob(jobtab + job, (stopped) ? -1 : lng, 1); if (func != BIN_BG) { /* fg or wait */ if (jobtab[job].pwd && strcmp(jobtab[job].pwd, pwd)) { fprintf(shout, "(pwd : "); -- cgit 1.4.1