Jacek Caban : jscript: Fixed numeric escapes unescaping.

Alexandre Julliard julliard at winehq.org
Wed Oct 8 08:32:41 CDT 2008


Module: wine
Branch: master
Commit: bb08e971edfa0a1b92cf52177ba04ce358bf6e56
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=bb08e971edfa0a1b92cf52177ba04ce358bf6e56

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue Oct  7 12:02:08 2008 -0500

jscript: Fixed numeric escapes unescaping.

---

 dlls/jscript/lex.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/dlls/jscript/lex.c b/dlls/jscript/lex.c
index 93397a3..a937804 100644
--- a/dlls/jscript/lex.c
+++ b/dlls/jscript/lex.c
@@ -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;
         }
 




More information about the wine-cvs mailing list