Module Name: src Committed By: kre Date: Sun Aug 19 10:47:45 UTC 2018
Modified Files: src/bin/sh: show.c Log Message: NFC: DEBUG mode only change. When tracing, show >&- as ">&-" rather than ">&-1" (the same op as >&n where internally n < 0 means "close") To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/bin/sh/show.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/show.c diff -u src/bin/sh/show.c:1.48 src/bin/sh/show.c:1.49 --- src/bin/sh/show.c:1.48 Sun Jul 22 20:38:06 2018 +++ src/bin/sh/show.c Sun Aug 19 10:47:45 2018 @@ -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 @@ shredir(union node *np, TFILE *fp, int f 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) {