Skip to content

Commit a74dbf1

Browse files
committed
e2e 698: the consumer's tool command survives cmd.exe's quote stripping on Windows
1 parent 1f13d21 commit a74dbf1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/e2e/698_a_tool_source_under_its_dependency_has_a_bounded_address.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ int main() {
123123
if (!tool || !*tool) { std::fprintf(stderr, "no tool path\n"); return 1; }
124124
std::string out = std::string(mcpp::out_dir()) + "/gen.cpp";
125125
std::string cmd = std::string("\"") + tool + "\" \"" + out + "\"";
126+
#ifdef _WIN32
127+
// cmd.exe strips the first and the last quote of the string it is given,
128+
// which splits two quoted words; a further pair keeps both intact.
129+
cmd = "\"" + cmd + "\"";
130+
#endif
126131
if (std::system(cmd.c_str()) != 0) { std::fprintf(stderr, "tool failed\n"); return 1; }
127132
mcpp::generated(out.c_str());
128133
}

0 commit comments

Comments
 (0)