]> git.saurik.com Git - wxWidgets.git/commitdiff
Worked around a crash in wxHTML on WinCE
authorJulian Smart <julian@anthemion.co.uk>
Thu, 2 Mar 2006 12:51:22 +0000 (12:51 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 2 Mar 2006 12:51:22 +0000 (12:51 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37776 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/html/htmlpars.cpp

index d6b6ab4c3230b96678f2e3c588c9405e6bc5c450..b9ef2b9f76984f1aa77cf4907da6c237fd227334 100644 (file)
@@ -833,11 +833,24 @@ wxChar wxHtmlEntitiesParser::GetEntityChar(const wxString& entity)
             while (substitutions[substitutions_cnt].code != 0)
                 substitutions_cnt++;
 
-        wxHtmlEntityInfo *info;
+        wxHtmlEntityInfo *info = NULL;
+#ifdef __WXWINCE__
+        // bsearch crashes under WinCE for some reason
+        size_t i;
+        for (i = 0; i < substitutions_cnt; i++)
+        {
+            if (entity == substitutions[i].name)
+            {
+                info = & substitutions[i];
+                break;
+            }
+        }
+#else
         info = (wxHtmlEntityInfo*) bsearch(entity.c_str(), substitutions,
                                            substitutions_cnt,
                                            sizeof(wxHtmlEntityInfo),
                                            wxHtmlEntityCompare);
+#endif
         if (info)
             code = info->code;
     }