Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Nov 2014 20:12:48 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r275346 - head/bin/sh
Message-ID:  <201411302012.sAUKCm9a061704@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jilles
Date: Sun Nov 30 20:12:47 2014
New Revision: 275346
URL: https://svnweb.freebsd.org/changeset/base/275346

Log:
  sh: Remove special case for '=' in set -x; always quote it in outqstr().
  
  I plan to make set -x output always printable using $'...'; avoiding quoting
  words containing '=' is not worth the extra complexity.

Modified:
  head/bin/sh/eval.c
  head/bin/sh/output.c

Modified: head/bin/sh/eval.c
==============================================================================
--- head/bin/sh/eval.c	Sun Nov 30 19:32:00 2014	(r275345)
+++ head/bin/sh/eval.c	Sun Nov 30 20:12:47 2014	(r275346)
@@ -774,15 +774,7 @@ xtracecommand(struct arglist *varlist, s
 	for (sp = arglist->list ; sp ; sp = sp->next) {
 		if (sep != 0)
 			out2c(' ');
-		/* Disambiguate command looking like assignment. */
-		if (sp == arglist->list &&
-				strchr(sp->text, '=') != NULL &&
-				strchr(sp->text, '\'') == NULL) {
-			out2c('\'');
-			out2str(sp->text);
-			out2c('\'');
-		} else
-			out2qstr(sp->text);
+		out2qstr(sp->text);
 		sep = ' ';
 	}
 	out2c('\n');

Modified: head/bin/sh/output.c
==============================================================================
--- head/bin/sh/output.c	Sun Nov 30 19:32:00 2014	(r275345)
+++ head/bin/sh/output.c	Sun Nov 30 20:12:47 2014	(r275346)
@@ -122,8 +122,7 @@ outqstr(const char *p, struct output *fi
 		outstr("''", file);
 		return;
 	}
-	/* Caller will handle '=' if necessary */
-	if (p[strcspn(p, "|&;<>()$`\\\"' \t\n*?[~#")] == '\0' ||
+	if (p[strcspn(p, "|&;<>()$`\\\"' \t\n*?[~#=")] == '\0' ||
 			strcmp(p, "[") == 0) {
 		outstr(p, file);
 		return;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411302012.sAUKCm9a061704>