about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--Src/jobs.c22
2 files changed, 20 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index e201d7f82..5c5675b3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2006-02-07  Peter Stephenson  <pws@csr.com>
 
+	* 22200: Src/jobs.c: process text wasn't unmetafied for output.
+
 	* 22198: README, Src/init.c, Src/params.c, Doc/Zsh/params.yo:
 	modify 22195 so that HOME gets set as before in native emulation.
 
diff --git a/Src/jobs.c b/Src/jobs.c
index 96250e84f..1e8ff8789 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -556,10 +556,18 @@ printtime(struct timeval *real, child_times_t *ti, char *desc)
 #ifdef HAVE_GETRUSAGE
     double total_time;
 #endif
-    int percent;
+    int percent, desclen;
 
     if (!desc)
+    {
 	desc = "";
+	desclen = 0;
+    }
+    else
+    {
+	desc = dupstring(desc);
+	unmetafy(desc, &desclen);
+    }
 
     /* go ahead and compute these, since almost every TIMEFMT will have them */
     elapsed_time = real->tv_sec + real->tv_usec / 1000000.0;
@@ -706,7 +714,7 @@ printtime(struct timeval *real, child_times_t *ti, char *desc)
 		break;
 #endif
 	    case 'J':
-		fprintf(stderr, "%s", desc);
+		fwrite(desc, sizeof(char), desclen, stderr);
 		break;
 	    case '%':
 		putc('%', stderr);
@@ -914,8 +922,14 @@ printjob(Job jn, int lng, int synch)
 			(int)(len - 14 + 2 - strlen(sigmsg(WTERMSIG(pn->status)))), "");
 	    else
 		fprintf(fout, "%-*s", len + 2, sigmsg(WTERMSIG(pn->status)));
-	    for (; pn != qn; pn = pn->next)
-		fprintf(fout, (pn->next) ? "%s | " : "%s", pn->text);
+	    for (; pn != qn; pn = pn->next) {
+		char *txt = dupstring(pn->text);
+		int txtlen;
+		unmetafy(txt, &txtlen);
+		fwrite(txt, sizeof(char), txtlen, fout);
+		if (pn->next)
+		    fputs(" | ", fout);
+	    }
 	    putc('\n', fout);
 	    fline = 0;
 	}