Jacek Caban : jscript: Added jsstr_flatten helper and use it to access string buffer in date.c.
Alexandre Julliard
julliard at winehq.org
Tue Mar 26 15:11:12 CDT 2013
Module: wine
Branch: master
Commit: e3d940334f24a15b967b88fa0cbbfe095dccc1f0
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e3d940334f24a15b967b88fa0cbbfe095dccc1f0
Author: Jacek Caban <jacek at codeweavers.com>
Date: Tue Mar 26 10:36:58 2013 +0100
jscript: Added jsstr_flatten helper and use it to access string buffer in date.c.
---
dlls/jscript/date.c | 4 +++-
dlls/jscript/jsstr.h | 6 ++++++
2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/dlls/jscript/date.c b/dlls/jscript/date.c
index 3d67248..d40d80f 100644
--- a/dlls/jscript/date.c
+++ b/dlls/jscript/date.c
@@ -2054,7 +2054,9 @@ static inline HRESULT date_parse(jsstr_t *input_str, double *ret) {
DWORD lcid_en;
input_len = jsstr_length(input_str);
- input = input_str->str;
+ input = jsstr_flatten(input_str);
+ if(!input)
+ return E_OUTOFMEMORY;
for(i=0; i<input_len; i++) {
if(input[i] == '(') nest_level++;
diff --git a/dlls/jscript/jsstr.h b/dlls/jscript/jsstr.h
index 709d1c6..09893fa 100644
--- a/dlls/jscript/jsstr.h
+++ b/dlls/jscript/jsstr.h
@@ -53,6 +53,12 @@ static inline jsstr_t *jsstr_addref(jsstr_t *str)
return str;
}
+/* This will be failable in the future. */
+static inline const WCHAR *jsstr_flatten(jsstr_t *str)
+{
+ return str->str;
+}
+
static inline BOOL jsstr_eq(jsstr_t *str1, jsstr_t *str2)
{
unsigned len = jsstr_length(str1);
More information about the wine-cvs
mailing list