Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
36391faf
Commit
36391faf
authored
Feb 18, 2011
by
Peter Urbanec
Committed by
Alexandre Julliard
Feb 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Implement character escaping as described by ECMA-262 B.2.1.
parent
27bb5a0f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
global.c
dlls/jscript/global.c
+9
-4
No files found.
dlls/jscript/global.c
View file @
36391faf
...
...
@@ -99,6 +99,13 @@ static inline BOOL is_uri_unescaped(WCHAR c)
return
c
<
128
&&
uri_char_table
[
c
]
==
2
;
}
/* Check that the character is one of the 69 nonblank characters as defined by ECMA-262 B.2.1 */
static
inline
BOOL
is_ecma_nonblank
(
const
WCHAR
c
)
{
return
((
c
>=
'A'
&&
c
<=
'Z'
)
||
(
c
>=
'a'
&&
c
<=
'z'
)
||
(
c
>=
'0'
&&
c
<=
'9'
)
||
c
==
'@'
||
c
==
'*'
||
c
==
'_'
||
c
==
'+'
||
c
==
'-'
||
c
==
'.'
||
c
==
'/'
);
}
static
WCHAR
int_to_char
(
int
i
)
{
if
(
i
<
10
)
...
...
@@ -290,8 +297,7 @@ static HRESULT JSGlobal_escape(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, D
for
(
ptr
=
str
;
*
ptr
;
ptr
++
)
{
if
(
*
ptr
>
0xff
)
len
+=
6
;
else
if
(
isalnum
((
unsigned
char
)
*
ptr
)
||
*
ptr
==
'*'
||
*
ptr
==
'@'
||
*
ptr
==
'-'
||
*
ptr
==
'_'
||
*
ptr
==
'+'
||
*
ptr
==
'.'
||
*
ptr
==
'/'
)
else
if
(
is_ecma_nonblank
(
*
ptr
))
len
++
;
else
len
+=
3
;
...
...
@@ -313,8 +319,7 @@ static HRESULT JSGlobal_escape(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, D
ret
[
len
++
]
=
int_to_char
((
*
ptr
>>
4
)
&
0xf
);
ret
[
len
++
]
=
int_to_char
(
*
ptr
&
0xf
);
}
else
if
(
isalnum
((
char
)
*
ptr
)
||
*
ptr
==
'*'
||
*
ptr
==
'@'
||
*
ptr
==
'-'
||
*
ptr
==
'_'
||
*
ptr
==
'+'
||
*
ptr
==
'.'
||
*
ptr
==
'/'
)
else
if
(
is_ecma_nonblank
(
*
ptr
))
ret
[
len
++
]
=
*
ptr
;
else
{
ret
[
len
++
]
=
'%'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment