about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPaul Ackersviller <packersv@users.sourceforge.net>2007-06-11 03:52:51 +0000
committerPaul Ackersviller <packersv@users.sourceforge.net>2007-06-11 03:52:51 +0000
commit6f99bd559b1c80051779b234ecc8f6cfa3d117b9 (patch)
treedde9c2de48cb9dde4aaffbd7ee1bc4a2d532ffd6 /Src
parent0e366c7caf81c45a7d31ac504d22e51b0fa48bd1 (diff)
downloadzsh-6f99bd559b1c80051779b234ecc8f6cfa3d117b9.tar.gz
zsh-6f99bd559b1c80051779b234ecc8f6cfa3d117b9.tar.xz
zsh-6f99bd559b1c80051779b234ecc8f6cfa3d117b9.zip
Merge of 21366: LONG_LIST_JOBS applies to more places where job listing are printed.
Diffstat (limited to 'Src')
-rw-r--r--Src/jobs.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/Src/jobs.c b/Src/jobs.c
index 1cf961cc3..55369ce85 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,
@@ -1344,7 +1344,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 ****/
@@ -1612,10 +1612,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);
@@ -1752,7 +1756,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 : ");