mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-06 21:14:58 -06:00
15.05
This commit is contained in:
committed by
Kornel Lesiński
parent
0713a3ab80
commit
54490d51d5
@@ -11,7 +11,7 @@ static bool IsString1PrefixedByString2_NoCase(const wchar_t *u, const char *a)
|
||||
char c = *a;
|
||||
if (c == 0)
|
||||
return true;
|
||||
if (MyCharLower_Ascii(c) != MyCharLower_Ascii(*u))
|
||||
if ((unsigned char)MyCharLower_Ascii(c) != MyCharLower_Ascii(*u))
|
||||
return false;
|
||||
a++;
|
||||
u++;
|
||||
@@ -135,24 +135,28 @@ bool CParser::ParseString(const UString &s, const CSwitchForm *switchForms)
|
||||
switch (form.Type)
|
||||
{
|
||||
case NSwitchType::kMinus:
|
||||
if (rem != 0)
|
||||
if (rem == 1)
|
||||
{
|
||||
sw.WithMinus = (s[pos] == '-');
|
||||
if (sw.WithMinus)
|
||||
pos++;
|
||||
return true;
|
||||
ErrorMessage = "Incorrect switch postfix:";
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case NSwitchType::kChar:
|
||||
if (rem != 0)
|
||||
if (rem == 1)
|
||||
{
|
||||
wchar_t c = s[pos];
|
||||
if (c <= 0x7F)
|
||||
{
|
||||
sw.PostCharIndex = FindCharPosInString(form.PostCharSet, (char)c);
|
||||
if (sw.PostCharIndex >= 0)
|
||||
pos++;
|
||||
return true;
|
||||
}
|
||||
ErrorMessage = "Incorrect switch postfix:";
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -160,6 +164,7 @@ bool CParser::ParseString(const UString &s, const CSwitchForm *switchForms)
|
||||
sw.PostStrings.Add((const wchar_t *)s + pos);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (pos != s.Len())
|
||||
{
|
||||
ErrorMessage = "Too long switch:";
|
||||
|
||||
Reference in New Issue
Block a user