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.
This commit is contained in:
parent
2c6bf3d90b
commit
e753a1effb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=275346
@ -774,15 +774,7 @@ xtracecommand(struct arglist *varlist, struct arglist *arglist)
|
|||||||
for (sp = arglist->list ; sp ; sp = sp->next) {
|
for (sp = arglist->list ; sp ; sp = sp->next) {
|
||||||
if (sep != 0)
|
if (sep != 0)
|
||||||
out2c(' ');
|
out2c(' ');
|
||||||
/* Disambiguate command looking like assignment. */
|
out2qstr(sp->text);
|
||||||
if (sp == arglist->list &&
|
|
||||||
strchr(sp->text, '=') != NULL &&
|
|
||||||
strchr(sp->text, '\'') == NULL) {
|
|
||||||
out2c('\'');
|
|
||||||
out2str(sp->text);
|
|
||||||
out2c('\'');
|
|
||||||
} else
|
|
||||||
out2qstr(sp->text);
|
|
||||||
sep = ' ';
|
sep = ' ';
|
||||||
}
|
}
|
||||||
out2c('\n');
|
out2c('\n');
|
||||||
|
@ -122,8 +122,7 @@ outqstr(const char *p, struct output *file)
|
|||||||
outstr("''", file);
|
outstr("''", file);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* Caller will handle '=' if necessary */
|
if (p[strcspn(p, "|&;<>()$`\\\"' \t\n*?[~#=")] == '\0' ||
|
||||||
if (p[strcspn(p, "|&;<>()$`\\\"' \t\n*?[~#")] == '\0' ||
|
|
||||||
strcmp(p, "[") == 0) {
|
strcmp(p, "[") == 0) {
|
||||||
outstr(p, file);
|
outstr(p, file);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user