Commit bb08e971 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Fixed numeric escapes unescaping.

parent 80bd994b
......@@ -243,13 +243,11 @@ static BOOL unescape(WCHAR *str)
case 'r':
c = '\r';
break;
case '0':
break;
case 'x':
i = hex_to_int(*++p);
if(i == -1)
return FALSE;
c = i << 16;
c = i << 4;
i = hex_to_int(*++p);
if(i == -1)
......@@ -260,17 +258,17 @@ static BOOL unescape(WCHAR *str)
i = hex_to_int(*++p);
if(i == -1)
return FALSE;
c = i << 24;
c = i << 12;
i = hex_to_int(*++p);
if(i == -1)
return FALSE;
c += i << 16;
c += i << 8;
i = hex_to_int(*++p);
if(i == -1)
return FALSE;
c += 1 << 8;
c += 1 << 4;
i = hex_to_int(*++p);
if(i == -1)
......@@ -278,6 +276,14 @@ static BOOL unescape(WCHAR *str)
c += i;
break;
default:
if(isdigitW(*p)) {
c = *p++ - '0';
while(isdigitW(*p))
c = c*10 + (*p++ - '0');
*pd++ = c;
continue;
}
c = *p;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment