mirror of
https://github.com/Relintai/osxcross.git
synced 2025-04-11 17:32:38 +02:00
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:
parent
1ef9def644
commit
cb8e8a4579
@ -289,7 +289,14 @@ bool parse(int argc, char **argv, Target &target) {
|
|||||||
char *arg = argv[i];
|
char *arg = argv[i];
|
||||||
|
|
||||||
if (*arg != '-') {
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user