]> granicus.if.org Git - php/commitdiff
Fix bug when length was queried before the string was converted.
authorWez Furlong <wez@php.net>
Wed, 22 May 2002 00:02:35 +0000 (00:02 +0000)
committerWez Furlong <wez@php.net>
Wed, 22 May 2002 00:02:35 +0000 (00:02 +0000)
sapi/activescript/scriptengine.cpp

index da4f51baa539feef3762a7334ac2f16b9251395d..ca751c2a5ff19b0c38465b9880ce00099dad0c5c 100644 (file)
@@ -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;