Skip to content

Commit 398588e

Browse files
logcmd: Only strip quotes on single arg
1 parent db90d1a commit 398588e

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

passes/cmds/logcmd.cc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,15 @@ struct LogPass : public Pass {
9393
if (push) { log_push(); return; }
9494
if (pop) { log_pop(); return; }
9595

96-
for (; argidx < args.size(); argidx++)
97-
text += args[argidx] + ' ';
98-
if (!text.empty()) text.resize(text.size()-1);
99-
100-
if (text.size() > 1 && text[0] == '"' && text[text.size()-1] == '"')
101-
text = text.substr(1, text.size()-2);
96+
text = args[argidx++];
97+
if (argidx < args.size()) {
98+
for (; argidx < args.size(); argidx++) {
99+
text += ' ' + args[argidx];
100+
}
101+
} else {
102+
if (text.size() > 1 && text[0] == '"' && text[text.size()-1] == '"')
103+
text = text.substr(1, text.size()-2);
104+
}
102105

103106
const char *fmtline = newline ? "%s\n" : "%s";
104107

0 commit comments

Comments
 (0)