about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2005-08-15 03:28:39 +0000
committerBart Schaefer <barts@users.sourceforge.net>2005-08-15 03:28:39 +0000
commit495f177f3aa8922073abf86ba1913119e180054f (patch)
tree52c11b6b4f79e9f4af486f1e3090db0eec5b8984
parent0cb28507d38d20223cb158e25e1c6abd3e07336f (diff)
downloadzsh-495f177f3aa8922073abf86ba1913119e180054f.tar.gz
zsh-495f177f3aa8922073abf86ba1913119e180054f.tar.xz
zsh-495f177f3aa8922073abf86ba1913119e180054f.zip
21366: LONG_LIST_JOBS applies to more places where job listings are printed
-rw-r--r--Src/jobs.c20
1 files changed, 12 insertions, 8 deletions
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 : ");