Skip to content

Commit

Permalink
Restore the original ini file format
Browse files Browse the repository at this point in the history
Restore the original ini file format, fix bugs
  • Loading branch information
YorkWaugh committed Oct 16, 2023
1 parent 28340d7 commit cc65121
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
26 changes: 24 additions & 2 deletions src/portable.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ std::wstring GetCommand(LPWSTR param)
{
auto cr_command_line = GetCrCommandLine();
std::wstring temp = cr_command_line;
temp = temp + L" ";
while (true)
{
auto pos = temp.find(L"=");
if (pos == std::wstring::npos)
{
args.push_back(temp);
break;
}
else
Expand All @@ -106,7 +106,6 @@ std::wstring GetCommand(LPWSTR param)
auto pos2 = temp.find(L" ", pos);
if (pos1 == std::wstring::npos || pos2 == std::wstring::npos)
{
args.push_back(temp);
break;
}
else
Expand All @@ -116,6 +115,29 @@ std::wstring GetCommand(LPWSTR param)
}
}
}

while (true)
{
auto pos1 = temp.find(L"--");
if (pos1 == std::wstring::npos)
{
break;
}
else
{
auto pos2 = temp.find(L"--", pos1 + 2);
if (pos2 == std::wstring::npos)
{
args.push_back(temp);
break;
}
else
{
args.push_back(temp.substr(pos1, pos2 - pos1));
temp = temp.substr(pos2);
}
}
}
}

{
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#define RELEASE_VER_MAIN 1
#define RELEASE_VER_SUB 5
#define RELEASE_VER_FIX 8
#define RELEASE_VER_FIX 9

#define TOSTRING2(arg) #arg
#define TOSTRING(arg) TOSTRING2(arg)
Expand Down

0 comments on commit cc65121

Please sign in to comment.