diff options
Diffstat (limited to 'qtools/qregexp.cpp')
-rw-r--r-- | qtools/qregexp.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/qtools/qregexp.cpp b/qtools/qregexp.cpp index d958f0a..8709858 100644 --- a/qtools/qregexp.cpp +++ b/qtools/qregexp.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** +** ** ** Implementation of QRegExp class ** @@ -901,8 +901,6 @@ static uint *dump( uint *p ) #endif // DEBUG -static const int maxlen = 1024; // max length of regexp array -static uint rxarray[ maxlen ]; // tmp regexp array /*! \internal @@ -913,6 +911,9 @@ static uint rxarray[ maxlen ]; // tmp regexp array void QRegExp::compile() { + const int maxlen = 1024; // max length of regexp array + uint rxarray[ maxlen ]; // tmp regexp array + if ( rxdata ) { // delete old data delete [] rxdata; rxdata = 0; @@ -1006,7 +1007,7 @@ void QRegExp::compile() numFields++; } if ( d >= rxarray + maxlen ) { // pattern too long - error = PatOverflow; + error = PatOverflow; return; } if ( !pl ) { // At least ']' should be left |