mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2025-02-16 17:35:39 +00:00
Fixed a possible INI file problem: unterminated strings will end at a newline now.
This commit is contained in:
parent
e223d388eb
commit
02c0c32398
|
@ -378,7 +378,7 @@ static bool IsBlank(char c)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetches a string. Tolerates all characters between quotes.
|
// Fetches a string. Tolerates all characters between quotes, except \n.
|
||||||
CINIFile::CToken CINIFile::GetString(void)
|
CINIFile::CToken CINIFile::GetString(void)
|
||||||
{
|
{
|
||||||
CToken T;
|
CToken T;
|
||||||
|
@ -394,7 +394,7 @@ CINIFile::CToken CINIFile::GetString(void)
|
||||||
++linePtr; // so we can find next token
|
++linePtr; // so we can find next token
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (linePtr[0] == '\0')
|
else if ((linePtr[0] == '\0') || (linePtr[0] == '\n'))
|
||||||
{
|
{
|
||||||
//printf("tokenizer: warning: string is missing end quote\n");
|
//printf("tokenizer: warning: string is missing end quote\n");
|
||||||
break;
|
break;
|
||||||
|
@ -537,7 +537,7 @@ CINIFile::CToken CINIFile::GetToken(void)
|
||||||
else if ((linePtr[0]==';') || (linePtr[0]=='\0'))
|
else if ((linePtr[0]==';') || (linePtr[0]=='\0'))
|
||||||
{
|
{
|
||||||
T.type = TOKEN_NULL;
|
T.type = TOKEN_NULL;
|
||||||
return T;
|
return T; // do not advance linePtr (so we do not de-sync the parser)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delimiters
|
// Delimiters
|
||||||
|
|
Loading…
Reference in a new issue