Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src/bin/sh Pullup the following revisions, requested by spz i...



details:   https://anonhg.NetBSD.org/src/rev/57b086ae62b9
branches:  netbsd-6
changeset: 776812:57b086ae62b9
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Dec 07 15:58:27 2014 +0000

description:
Pullup the following revisions, requested by spz in #1205:
src/bin/sh/jobs.c       1.73

PR/48729: Torbj?rn Granlund: Avoid negative index in array ref.

diffstat:

 bin/sh/jobs.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 036813055e00 -r 57b086ae62b9 bin/sh/jobs.c
--- a/bin/sh/jobs.c     Sun Dec 07 15:21:37 2014 +0000
+++ b/bin/sh/jobs.c     Sun Dec 07 15:58:27 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: jobs.c,v 1.69 2011/06/18 21:18:46 christos Exp $       */
+/*     $NetBSD: jobs.c,v 1.69.4.1 2014/12/07 15:58:27 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.69 2011/06/18 21:18:46 christos Exp $");
+__RCSID("$NetBSD: jobs.c,v 1.69.4.1 2014/12/07 15:58:27 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -636,7 +636,7 @@
                        if (dowait(WBLOCK|WNOFREE, job) == -1)
                               return 128 + SIGINT;
                }
-               status = job->ps[job->nprocs - 1].status;
+               status = job->ps[job->nprocs ? job->nprocs - 1 : 0].status;
                if (WIFEXITED(status))
                        retval = WEXITSTATUS(status);
 #if JOBS



Home | Main Index | Thread Index | Old Index