svn commit: r249984 - head/bin/sh

Jilles Tjoelker jilles at FreeBSD.org
Sat Apr 27 14:07:26 UTC 2013


Author: jilles
Date: Sat Apr 27 14:07:25 2013
New Revision: 249984
URL: http://svnweb.freebsd.org/changeset/base/249984

Log:
  sh: Don't consider jobs -s/-p as reporting the status of jobs.
  
  This ensures that something like j=$(jobs -p) does not prevent any
  status from being written to the terminal.

Modified:
  head/bin/sh/jobs.c

Modified: head/bin/sh/jobs.c
==============================================================================
--- head/bin/sh/jobs.c	Sat Apr 27 13:26:35 2013	(r249983)
+++ head/bin/sh/jobs.c	Sat Apr 27 14:07:25 2013	(r249984)
@@ -417,13 +417,15 @@ showjobs(int change, int mode)
 		if (change && ! jp->changed)
 			continue;
 		showjob(jp, mode);
-		jp->changed = 0;
-		/* Hack: discard jobs for which $! has not been referenced
-		 * in interactive mode when they terminate.
-		 */
-		if (jp->state == JOBDONE && !jp->remembered &&
-				(iflag || jp != bgjob)) {
-			freejob(jp);
+		if (mode == SHOWJOBS_DEFAULT || mode == SHOWJOBS_VERBOSE) {
+			jp->changed = 0;
+			/* Hack: discard jobs for which $! has not been
+			 * referenced in interactive mode when they terminate.
+			 */
+			if (jp->state == JOBDONE && !jp->remembered &&
+					(iflag || jp != bgjob)) {
+				freejob(jp);
+			}
 		}
 	}
 }


More information about the svn-src-head mailing list