+ fix: command line position args

This commit is contained in:
Rainer Kottenhoff 2018-09-18 02:07:49 +02:00
parent 61df030037
commit 692a5076bf
2 changed files with 11 additions and 9 deletions

View File

@ -2779,11 +2779,12 @@ void DialogNewWindow(HWND hwnd, bool bSaveOnRunTools, bool bSetCurFile)
if (bSaveOnRunTools && !FileSave(false, true, false, false)) { return; }
GetModuleFileName(NULL, szModuleName, COUNTOF(szModuleName));
NormalizePathEx(szModuleName, COUNTOF(szModuleName));
StringCchPrintf(tch, COUNTOF(tch), L"\"-appid=%s\"", g_wchAppUserModelID);
StringCchCopy(szParameters, COUNTOF(szParameters), tch);
StringCchPrintf(tch, COUNTOF(tch), L" \"-sysmru=%i\"", (g_flagUseSystemMRU == 2) ? 1 : 0);
StringCchPrintf(tch, COUNTOF(tch), L"\" -sysmru=%i\"", (g_flagUseSystemMRU == 2) ? 1 : 0);
StringCchCat(szParameters, COUNTOF(szParameters), tch);
StringCchCat(szParameters, COUNTOF(szParameters), L" -f");

View File

@ -7271,16 +7271,17 @@ void ParseCommandLine()
while (bContinue && ExtractFirstArgument(lp3, lp1, lp2, (int)len)) {
// options
if (!bIsFileArg && (StringCchCompareN(lp1, len, L"+", 1) == 0)) {
g_flagMultiFileArg = 2;
bIsFileArg = true;
}
if (lp1[1] == L'\0') {
if (!bIsFileArg && (lp1[0] == L'+')) {
g_flagMultiFileArg = 2;
bIsFileArg = true;
}
else if (!bIsFileArg && (StringCchCompareN(lp1, len, L"-", 1) == 0)) {
g_flagMultiFileArg = 1;
bIsFileArg = true;
else if (!bIsFileArg && (lp1[0] == L'-')) {
g_flagMultiFileArg = 1;
bIsFileArg = true;
}
}
else if (!bIsFileArg && ((*lp1 == L'/') || (*lp1 == L'-'))) {
// LTrim