This commit is contained in:
Igor Pavlov
2015-06-15 00:00:00 +00:00
committed by Kornel Lesiński
parent 0713a3ab80
commit 54490d51d5
591 changed files with 34932 additions and 16390 deletions

View File

@@ -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:";