summaryrefslogtreecommitdiff
path: root/sapi/activescript/scriptengine.cpp
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2002-05-22 00:02:35 +0000
committerWez Furlong <wez@php.net>2002-05-22 00:02:35 +0000
commit139fd6a8e459b214bc5e947bf6a30e7953ac1b06 (patch)
tree3e5a6f522efd0c5e7574434d7c68c0de225a7033 /sapi/activescript/scriptengine.cpp
parent762effcf6094d94b99093de0985990d48510fd94 (diff)
downloadphp-git-139fd6a8e459b214bc5e947bf6a30e7953ac1b06.tar.gz
Fix bug when length was queried before the string was converted.
Diffstat (limited to 'sapi/activescript/scriptengine.cpp')
-rw-r--r--sapi/activescript/scriptengine.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/sapi/activescript/scriptengine.cpp b/sapi/activescript/scriptengine.cpp
index da4f51baa5..ca751c2a5f 100644
--- a/sapi/activescript/scriptengine.cpp
+++ b/sapi/activescript/scriptengine.cpp
@@ -116,7 +116,12 @@ class TWideString {
return ret;
}
- int ansi_len(void) { return m_ansi_strlen; }
+ int ansi_len(void) {
+ /* force conversion if it has not already occurred */
+ if (m_ansi == NULL)
+ ansi_string();
+ return m_ansi_strlen;
+ }
static BSTR bstr_from_ansi(char *ansi) {
OLECHAR *ole = NULL;