svn commit: r275346 - head/bin/sh

Jilles Tjoelker jilles at FreeBSD.org
Sun Nov 30 20:12:49 UTC 2014


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;


More information about the svn-src-all mailing list