From 9c60ef71f110cf643153c9b254ed60e89a76f66b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Mon, 18 Sep 2000 20:00:19 +0000 Subject: [PATCH] backmerged bugfix in wxHtmlParser::DoParsing (text between two tags longer than 1024 characters was not parsed correctyl) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@8398 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/html/htmlpars.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/html/htmlpars.cpp b/src/html/htmlpars.cpp index 7986e96101..65066aeddc 100644 --- a/src/html/htmlpars.cpp +++ b/src/html/htmlpars.cpp @@ -69,11 +69,13 @@ void wxHtmlParser::DoneParser() -#define wxHTML_MAX_BUFLEN 1024 void wxHtmlParser::DoParsing(int begin_pos, int end_pos) { - char temp[wxHTML_BUFLEN], c; + if (end_pos <= begin_pos) return; + + char c; + char *temp = new char[end_pos - begin_pos + 1]; int i; int templen; @@ -86,11 +88,6 @@ void wxHtmlParser::DoParsing(int begin_pos, int end_pos) // continue building word: if (c != '<') { temp[templen++] = c; - if (templen == wxHTML_BUFLEN-1) { - temp[templen] = 0; - AddText(temp); - templen = 0; - } i++; } @@ -112,6 +109,7 @@ void wxHtmlParser::DoParsing(int begin_pos, int end_pos) temp[templen] = 0; AddText(temp); } + delete[] temp; }