mirror of
https://github.com/autc04/Retro68.git
synced 2024-12-28 14:31:50 +00:00
fix handling of \n, \r, \t escape sequences in strings
This commit is contained in:
parent
eadbe38cfc
commit
8cd19154a5
@ -45,7 +45,7 @@ static int readInt(const char *str, const char *end = NULL, int baseOverride = 0
|
|||||||
x += *str - 'A' + 10;
|
x += *str - 'A' + 10;
|
||||||
else if(*str >= '0' && *str <= '9')
|
else if(*str >= '0' && *str <= '9')
|
||||||
x += *str - '0';
|
x += *str - '0';
|
||||||
*str++;
|
str++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return x;
|
return x;
|
||||||
@ -86,13 +86,13 @@ static std::string readStringLit(const char *str)
|
|||||||
switch(*p)
|
switch(*p)
|
||||||
{
|
{
|
||||||
case 'n':
|
case 'n':
|
||||||
out << '\n';
|
out << '\n'; ++p;
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
out << '\r';
|
out << '\r'; ++p;
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
out << '\t';
|
out << '\t'; ++p;
|
||||||
break;
|
break;
|
||||||
case '0':
|
case '0':
|
||||||
case '1':
|
case '1':
|
||||||
|
Loading…
Reference in New Issue
Block a user