about summary refs log tree commit diff
path: root/Src/jobs.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2006-11-03 19:44:47 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2006-11-03 19:44:47 +0000
commitebc76673aaa9a4f1017a67ae65a1acee10f6bb42 (patch)
tree80af3ee1ae5b7f1c15f636d85ec91141e033a764 /Src/jobs.c
parentd8207acddbd1ad5e9339115f7b7bf09820b98c5a (diff)
downloadzsh-ebc76673aaa9a4f1017a67ae65a1acee10f6bb42.tar.gz
zsh-ebc76673aaa9a4f1017a67ae65a1acee10f6bb42.tar.xz
zsh-ebc76673aaa9a4f1017a67ae65a1acee10f6bb42.zip
22953: Mikael Magnusson: _most_recent_file fix.
users/10928: send all "jobs" output to stdout
Diffstat (limited to 'Src/jobs.c')
-rw-r--r--Src/jobs.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/Src/jobs.c b/Src/jobs.c
index 5b42a45b0..166314e74 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -954,10 +954,10 @@ printjob(Job jn, int lng, int synch)
 
     if ((lng & 4) || (interact && job == thisjob &&
 		      jn->pwd && strcmp(jn->pwd, pwd))) {
-	fprintf(shout, "(pwd %s: ", (lng & 4) ? "" : "now");
-	fprintdir(((lng & 4) && jn->pwd) ? jn->pwd : pwd, shout);
-	fprintf(shout, ")\n");
-	fflush(shout);
+	fprintf(fout, "(pwd %s: ", (lng & 4) ? "" : "now");
+	fprintdir(((lng & 4) && jn->pwd) ? jn->pwd : pwd, fout);
+	fprintf(fout, ")\n");
+	fflush(fout);
     }
 /* delete job if done */
 
@@ -1827,11 +1827,12 @@ bin_fg(char *name, char **argv, Options ops, int func)
 		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 : ");
-		    fprintdir(jobtab[job].pwd, shout);
-		    fprintf(shout, ")\n");
+		    FILE *fout = (func == BIN_JOBS) ? stdout : shout;
+		    fprintf(fout, "(pwd : ");
+		    fprintdir(jobtab[job].pwd, fout);
+		    fprintf(fout, ")\n");
+		    fflush(fout);
 		}
-		fflush(shout);
 		if (func != BIN_WAIT) {		/* fg */
 		    thisjob = job;
 		    if ((jobtab[job].stat & STAT_SUPERJOB) &&