Check if the arguments have spaces in them and add back the quotes argv

parsing removes. This fixes issues with the MT flag among others.
-MT "stubdata.d stubdata.o stubdata.ao"
This commit is contained in:
Pedro Navarro 2017-05-18 12:59:20 -07:00
parent 1ef9def644
commit cb8e8a4579

View File

@ -289,7 +289,14 @@ bool parse(int argc, char **argv, Target &target) {
char *arg = argv[i];
if (*arg != '-') {
target.args.push_back(arg);
// Check if the argument has spaces, we need to add back the quotes if
// that's the case
std::string argument = arg;
if (argument.find_first_of("\t\n ") != std::string::npos) {
argument = "\"" + argument + "\"";
}
target.args.push_back(argument);
continue;
}