mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2024-11-22 13:55:38 +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;
|
||||
}
|
||||
|
||||
// Fetches a string. Tolerates all characters between quotes.
|
||||
// Fetches a string. Tolerates all characters between quotes, except \n.
|
||||
CINIFile::CToken CINIFile::GetString(void)
|
||||
{
|
||||
CToken T;
|
||||
|
@ -394,7 +394,7 @@ CINIFile::CToken CINIFile::GetString(void)
|
|||
++linePtr; // so we can find next token
|
||||
break;
|
||||
}
|
||||
else if (linePtr[0] == '\0')
|
||||
else if ((linePtr[0] == '\0') || (linePtr[0] == '\n'))
|
||||
{
|
||||
//printf("tokenizer: warning: string is missing end quote\n");
|
||||
break;
|
||||
|
@ -537,7 +537,7 @@ CINIFile::CToken CINIFile::GetToken(void)
|
|||
else if ((linePtr[0]==';') || (linePtr[0]=='\0'))
|
||||
{
|
||||
T.type = TOKEN_NULL;
|
||||
return T;
|
||||
return T; // do not advance linePtr (so we do not de-sync the parser)
|
||||
}
|
||||
|
||||
// Delimiters
|
||||
|
|
Loading…
Reference in a new issue