Source-Changes-HG archive

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

[src/trunk]: src/bin/sh NFC: DEBUG mode only change. When tracing, show >&-...



details:   https://anonhg.NetBSD.org/src/rev/b631dc327563
branches:  trunk
changeset: 992218:b631dc327563
user:      kre <kre%NetBSD.org@localhost>
date:      Sun Aug 19 10:47:45 2018 +0000

description:
NFC: DEBUG mode only change.   When tracing, show >&- as ">&-"
rather than ">&-1" (the same op as >&n where internally n < 0
means "close")

diffstat:

 bin/sh/show.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 303db787ae5b -r b631dc327563 bin/sh/show.c
--- a/bin/sh/show.c     Sun Aug 19 10:33:49 2018 +0000
+++ b/bin/sh/show.c     Sun Aug 19 10:47:45 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: show.c,v 1.48 2018/07/22 20:38:06 kre Exp $    */
+/*     $NetBSD: show.c,v 1.49 2018/08/19 10:47:45 kre Exp $    */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)show.c     8.3 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: show.c,v 1.48 2018/07/22 20:38:06 kre Exp $");
+__RCSID("$NetBSD: show.c,v 1.49 2018/08/19 10:47:45 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -614,8 +614,12 @@
                        if (np->ndup.vname)
                                sharg(np->ndup.vname, fp);
                        else {
-                               sprintf(buf, "%d", np->ndup.dupfd);
-                               trace_puts(buf, fp);
+                               if (np->ndup.dupfd < 0)
+                                       trace_puts("-", fp);
+                               else {
+                                       sprintf(buf, "%d", np->ndup.dupfd);
+                                       trace_puts(buf, fp);
+                               }
                        }
                } else
                    if (np->nfile.type == NHERE || np->nfile.type == NXHERE) {



Home | Main Index | Thread Index | Old Index