Module Name:    src
Committed By:   martin
Date:           Tue Oct  9 09:51:57 UTC 2018

Modified Files:
        src/bin/sh [netbsd-8]: jobs.c

Log Message:
Pull up following revision(s) (requested by kre in ticket #1050):

        bin/sh/jobs.c: revision 1.101

A change in rev 1.91 interacted badly with the way that showjobs()
worked, preventing $(jobs) (and more usefully $(jobs -p) from
working.   Fix that.

XXX pullup -8


To generate a diff of this commit:
cvs rdiff -u -r1.85.2.2 -r1.85.2.3 src/bin/sh/jobs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/jobs.c
diff -u src/bin/sh/jobs.c:1.85.2.2 src/bin/sh/jobs.c:1.85.2.3
--- src/bin/sh/jobs.c:1.85.2.2	Fri Nov 17 14:56:52 2017
+++ src/bin/sh/jobs.c	Tue Oct  9 09:51:57 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: jobs.c,v 1.85.2.2 2017/11/17 14:56:52 martin Exp $	*/
+/*	$NetBSD: jobs.c,v 1.85.2.3 2018/10/09 09:51:57 martin Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)jobs.c	8.5 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: jobs.c,v 1.85.2.2 2017/11/17 14:56:52 martin Exp $");
+__RCSID("$NetBSD: jobs.c,v 1.85.2.3 2018/10/09 09:51:57 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -578,14 +578,13 @@ showjobs(struct output *out, int mode)
 		silent = 1;
 	}
 #endif
-	if (jobs_invalid)
-		return;
 
 	for (jobno = 1, jp = jobtab ; jobno <= njobs ; jobno++, jp++) {
 		if (!jp->used)
 			continue;
 		if (jp->nprocs == 0) {
-			freejob(jp);
+			if (!jobs_invalid)
+				freejob(jp);
 			continue;
 		}
 		if ((mode & SHOW_CHANGED) && !jp->changed)

Reply via email to