Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
f0c0c142
Commit
f0c0c142
authored
Dec 18, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Moved string concatenation to helper function.
parent
3b197749
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
12 deletions
+23
-12
engine.c
dlls/jscript/engine.c
+3
-12
jsstr.c
dlls/jscript/jsstr.c
+19
-0
jsstr.h
dlls/jscript/jsstr.h
+1
-0
No files found.
dlls/jscript/engine.c
View file @
f0c0c142
...
...
@@ -1447,22 +1447,13 @@ static HRESULT add_eval(script_ctx_t *ctx, jsval_t lval, jsval_t rval, jsval_t *
hres
=
to_string
(
ctx
,
r
,
&
rstr
);
if
(
SUCCEEDED
(
hres
))
{
unsigned
len1
,
len2
;
jsstr_t
*
ret_str
;
len1
=
jsstr_length
(
lstr
);
len2
=
jsstr_length
(
rstr
);
ret_str
=
jsstr_alloc_buf
(
len1
+
len2
);
if
(
ret_str
)
{
if
(
len1
)
memcpy
(
ret_str
->
str
,
lstr
->
str
,
len1
*
sizeof
(
WCHAR
));
if
(
len2
)
memcpy
(
ret_str
->
str
+
len1
,
rstr
->
str
,
len2
*
sizeof
(
WCHAR
));
ret_str
=
jsstr_concat
(
lstr
,
rstr
);
if
(
ret_str
)
*
ret
=
jsval_string
(
ret_str
);
}
else
{
else
hres
=
E_OUTOFMEMORY
;
}
}
jsstr_release
(
lstr
);
...
...
dlls/jscript/jsstr.c
View file @
f0c0c142
...
...
@@ -66,6 +66,25 @@ int jsstr_cmp(jsstr_t *str1, jsstr_t *str2)
return
ret
;
}
jsstr_t
*
jsstr_concat
(
jsstr_t
*
str1
,
jsstr_t
*
str2
)
{
unsigned
len1
,
len2
;
jsstr_t
*
ret
;
len1
=
jsstr_length
(
str1
);
len2
=
jsstr_length
(
str2
);
ret
=
jsstr_alloc_buf
(
len1
+
len2
);
if
(
!
ret
)
return
NULL
;
if
(
len1
)
memcpy
(
ret
->
str
,
str1
->
str
,
len1
*
sizeof
(
WCHAR
));
if
(
len2
)
memcpy
(
ret
->
str
+
len1
,
str2
->
str
,
len2
*
sizeof
(
WCHAR
));
return
ret
;
}
static
jsstr_t
*
empty_str
,
*
nan_str
;
jsstr_t
*
jsstr_nan
(
void
)
...
...
dlls/jscript/jsstr.h
View file @
f0c0c142
...
...
@@ -60,6 +60,7 @@ static inline BOOL jsstr_eq(jsstr_t *str1, jsstr_t *str2)
}
int
jsstr_cmp
(
jsstr_t
*
,
jsstr_t
*
)
DECLSPEC_HIDDEN
;
jsstr_t
*
jsstr_concat
(
jsstr_t
*
,
jsstr_t
*
)
DECLSPEC_HIDDEN
;
jsstr_t
*
jsstr_nan
(
void
)
DECLSPEC_HIDDEN
;
jsstr_t
*
jsstr_empty
(
void
)
DECLSPEC_HIDDEN
;
...
...
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