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
25dbf32b
Commit
25dbf32b
authored
Mar 06, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 06, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Reimplemented do_attributeless_tag_format without direct access to object's string buffer.
parent
72226ea8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
11 deletions
+28
-11
string.c
dlls/jscript/string.c
+28
-11
No files found.
dlls/jscript/string.c
View file @
25dbf32b
...
...
@@ -144,27 +144,44 @@ static HRESULT String_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un
static
HRESULT
do_attributeless_tag_format
(
script_ctx_t
*
ctx
,
vdisp_t
*
jsthis
,
jsval_t
*
r
,
const
WCHAR
*
tagname
)
{
jsstr_t
*
str
;
unsigned
tagname_len
;
jsstr_t
*
str
,
*
ret
;
WCHAR
*
ptr
;
HRESULT
hres
;
static
const
WCHAR
tagfmt
[]
=
{
'<'
,
'%'
,
's'
,
'>'
,
'%'
,
's'
,
'<'
,
'/'
,
'%'
,
's'
,
'>'
,
0
};
hres
=
get_string_val
(
ctx
,
jsthis
,
&
str
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
r
)
{
jsstr_t
*
ret
=
jsstr_alloc_buf
(
jsstr_length
(
str
)
+
2
*
strlenW
(
tagname
)
+
5
);
if
(
!
ret
)
{
jsstr_release
(
str
);
return
E_OUTOFMEMORY
;
}
if
(
!
r
)
{
jsstr_release
(
str
);
return
S_OK
;
}
sprintfW
(
ret
->
str
,
tagfmt
,
tagname
,
str
->
str
,
tagname
);
*
r
=
jsval_string
(
ret
);
tagname_len
=
strlenW
(
tagname
);
ret
=
jsstr_alloc_buf
(
jsstr_length
(
str
)
+
2
*
tagname_len
+
5
);
if
(
!
ret
)
{
jsstr_release
(
str
);
return
E_OUTOFMEMORY
;
}
ptr
=
ret
->
str
;
*
ptr
++
=
'<'
;
memcpy
(
ptr
,
tagname
,
tagname_len
*
sizeof
(
WCHAR
));
ptr
+=
tagname_len
;
*
ptr
++
=
'>'
;
ptr
+=
jsstr_flush
(
str
,
ptr
);
jsstr_release
(
str
);
*
ptr
++
=
'<'
;
*
ptr
++
=
'/'
;
memcpy
(
ptr
,
tagname
,
tagname_len
*
sizeof
(
WCHAR
));
ptr
+=
tagname_len
;
*
ptr
=
'>'
;
*
r
=
jsval_string
(
ret
);
return
S_OK
;
}
...
...
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