mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-07 11:14:58 -06:00
9.19
This commit is contained in:
committed by
Kornel Lesiński
parent
c65230d858
commit
b75af1bba6
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace NCommandLineParser {
|
||||
|
||||
void SplitCommandLine(const UString &src, UString &dest1, UString &dest2)
|
||||
bool SplitCommandLine(const UString &src, UString &dest1, UString &dest2)
|
||||
{
|
||||
dest1.Empty();
|
||||
dest2.Empty();
|
||||
@@ -15,17 +15,17 @@ void SplitCommandLine(const UString &src, UString &dest1, UString &dest2)
|
||||
for (i = 0; i < src.Length(); i++)
|
||||
{
|
||||
wchar_t c = src[i];
|
||||
if (c == L' ' && !quoteMode)
|
||||
{
|
||||
dest2 = src.Mid(i + 1);
|
||||
return i != 0;
|
||||
}
|
||||
if (c == L'\"')
|
||||
quoteMode = !quoteMode;
|
||||
else if (c == L' ' && !quoteMode)
|
||||
{
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
else
|
||||
dest1 += c;
|
||||
}
|
||||
dest2 = src.Mid(i);
|
||||
return i != 0;
|
||||
}
|
||||
|
||||
void SplitCommandLine(const UString &s, UStringVector &parts)
|
||||
@@ -36,10 +36,7 @@ void SplitCommandLine(const UString &s, UStringVector &parts)
|
||||
for (;;)
|
||||
{
|
||||
UString s1, s2;
|
||||
SplitCommandLine(sTemp, s1, s2);
|
||||
// s1.Trim();
|
||||
// s2.Trim();
|
||||
if (!s1.IsEmpty())
|
||||
if (SplitCommandLine(sTemp, s1, s2))
|
||||
parts.Add(s1);
|
||||
if (s2.IsEmpty())
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user