Fixed '-debug' and '-version' handling in LDMD.

No idea how the old version once passed the test suite.
This commit is contained in:
David Nadlinger
2012-08-31 23:31:29 +02:00
parent 6fea7358dc
commit c941640d17

View File

@@ -593,7 +593,8 @@ Params parseArgs(int originalArgc, char** originalArgv, ls::Path ldcPath)
goto Lerror;
result.debugLevel = (int)level;
}
result.debugIdentifiers.push_back(p + 7);
else
result.debugIdentifiers.push_back(p + 7);
}
else if (p[6])
goto Lerror;
@@ -616,7 +617,8 @@ Params parseArgs(int originalArgc, char** originalArgv, ls::Path ldcPath)
goto Lerror;
result.versionLevel = (int)level;
}
result.versionIdentifiers.push_back(p + 9);
else
result.versionIdentifiers.push_back(p + 9);
}
else
goto Lerror;
@@ -769,7 +771,7 @@ void buildCommandLine(std::vector<const char*>& r, const Params& p)
if (p.debugFlag) r.push_back("-d-debug");
if (p.debugLevel) r.push_back(concat("-d-debug=", p.debugLevel));
pushSwitches("-d-debug=", p.debugIdentifiers, r);
if (p.debugLevel) r.push_back(concat("-d-version=", p.versionLevel));
if (p.versionLevel) r.push_back(concat("-d-version=", p.versionLevel));
pushSwitches("-d-version=", p.versionIdentifiers, r);
pushSwitches("-L=", p.linkerSwitches, r);
if (p.defaultLibName) r.push_back(concat("-defaultlib=", p.defaultLibName));