diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f9b5129686..800e784d79 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,11 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ +2007-06-06 15:40 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/include/hbregex.h + * harbour/source/rtl/hbregex.c + ! fixed GPF and removed two hacks + 2007-06-06 14:02 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/rtl/hbregex.c ! added workaround for some wrong hack (to check if both can be diff --git a/harbour/include/hbregex.h b/harbour/include/hbregex.h index 2991529091..2405374f3e 100644 --- a/harbour/include/hbregex.h +++ b/harbour/include/hbregex.h @@ -94,7 +94,7 @@ typedef HB_REGEX * PHB_REGEX; #if defined( HB_PCRE_REGEX ) #define HB_REGMATCH int - #define HB_REGMATCH_SIZE( n ) ( ( n + 1 ) * 3 ) + #define HB_REGMATCH_SIZE( n ) ( ( n ) * 3 ) #define HB_REGMATCH_SO( p, n ) ( p )[ ( n ) * 2 ] #define HB_REGMATCH_EO( p, n ) ( p )[ ( n ) * 2 + 1 ] #elif defined( HB_POSIX_REGEX ) diff --git a/harbour/source/rtl/hbregex.c b/harbour/source/rtl/hbregex.c index 39107493f3..6b1a4a32a4 100644 --- a/harbour/source/rtl/hbregex.c +++ b/harbour/source/rtl/hbregex.c @@ -106,12 +106,9 @@ static int hb_regexec( PHB_REGEX pRegEx, const char * szString, ULONG ulLen, #if defined( HB_PCRE_REGEX ) int iResult, i; - for( i = 0; i < iMatches; i++ ) - HB_REGMATCH_EO( aMatches, i ) = -1; - iResult = pcre_exec( pRegEx->re_pcre, NULL /* pcre_extra */, szString, ulLen, 0 /* startoffset */, - pRegEx->iEFlags, aMatches, iMatches + 1 ); + pRegEx->iEFlags, aMatches, HB_REGMATCH_SIZE( iMatches ) ); if( iResult == 0 ) { for( i = 0; i < iMatches; i++ )