Module Name:    src
Committed By:   kre
Date:           Thu Feb 14 13:27:59 UTC 2019

Modified Files:
        src/bin/sh: show.c

Log Message:
DEBUG mode only change.   When pretty-printing a word from a parse
tree, don't display a CTLESC which is there only to protect a CTL*
char (a data char that happens to have the same value).  No actual
CTL* chars are printed as data, so no escaping is needed to protect
data which just happens to look the same.  Dropping this avoids the
possibility of confusion/ambiguity in what the word actually contains.

NFC for any normal shell build (very little of this file gets compiled there)


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 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.52 src/bin/sh/show.c:1.53
--- src/bin/sh/show.c:1.52	Tue Jan 22 13:48:28 2019
+++ src/bin/sh/show.c	Thu Feb 14 13:27:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: show.c,v 1.52 2019/01/22 13:48:28 kre Exp $	*/
+/*	$NetBSD: show.c,v 1.53 2019/02/14 13:27:59 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.52 2019/01/22 13:48:28 kre Exp $");
+__RCSID("$NetBSD: show.c,v 1.53 2019/02/14 13:27:59 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -645,7 +645,8 @@ sharg(union node *arg, TFILE *fp)
 	for (p = arg->narg.text ; *p ; p++) {
 		switch (*p) {
 		case CTLESC:
-			trace_putc('\\', fp);
+			if (BASESYNTAX[p[1]] != CCTL)
+				trace_putc('\\', fp);
 			trace_putc(*++p, fp);
 			break;
 

Reply via email to