mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
Host_Loadgame_f: don't break when there are } characters in quoted strings. Fixes issue loading savegames from retrojam1_skacky
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1145 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
fd219279f4
commit
6afd1e5286
1 changed files with 6 additions and 1 deletions
|
@ -1055,13 +1055,18 @@ void Host_Loadgame_f (void)
|
|||
entnum = -1; // -1 is the globals
|
||||
while (!feof(f))
|
||||
{
|
||||
qboolean inside_string = false;
|
||||
for (i = 0; i < (int) sizeof(str) - 1; i++)
|
||||
{
|
||||
r = fgetc (f);
|
||||
if (r == EOF || !r)
|
||||
break;
|
||||
str[i] = r;
|
||||
if (r == '}')
|
||||
if (r == '"')
|
||||
{
|
||||
inside_string = !inside_string;
|
||||
}
|
||||
else if (r == '}' && !inside_string) // only handle } characters outside of quoted strings
|
||||
{
|
||||
i++;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue