diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 8b61e6a0dc..2f60455348 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,7 @@ +2000-08-11 11:25 GMT+3 Alexander Kresin + * source/pp/ppcore.c + * Bug fixed, noted by Victor Szel + 2000-08-11 08:55 UTC+0100 Ryszard Glab *source/compiler/harbour.l diff --git a/harbour/source/pp/ppcore.c b/harbour/source/pp/ppcore.c index 54b27fb18b..cd1c293077 100644 --- a/harbour/source/pp/ppcore.c +++ b/harbour/source/pp/ppcore.c @@ -2566,7 +2566,7 @@ static int md_strAt( char * szSub, int lSubLen, char * szText, BOOL checkword, B { int State = STATE_NORMAL; long lPos = 0, lSubPos = 0; - int kolPrth = 0; + int kolPrth = 0, kolSquare = 0; int lCase = ( *szSub == '\1' )? 0:1; HB_TRACE(HB_TR_DEBUG, ("md_strAt(%s, %d, %s, %d, %d)", szSub, lSubLen, szText, checkword, checkPrth)); @@ -2591,10 +2591,18 @@ static int md_strAt( char * szSub, int lSubLen, char * szText, BOOL checkword, B { if( *(szText+lPos) == ']' && ( lPos == 0 || *(szText+lPos-1) != '\\' ) ) { - State = STATE_NORMAL; + kolSquare--; + if( kolSquare == 0 ) + State = STATE_NORMAL; lPos++; continue; } + else if( *(szText+lPos) == '[' && ( lPos == 0 || *(szText+lPos-1) != '\\' ) ) + { + kolSquare++; + lPos++; + continue; + } } else { @@ -2604,7 +2612,7 @@ static int md_strAt( char * szSub, int lSubLen, char * szText, BOOL checkword, B lPos++; continue; } - else if( *(szText+lPos) == '\'' && ( lPos == 0 || *(szText+lPos-1) != '\\' ) ) + else if( ( *(szText+lPos) == '\'' || *(szText+lPos) == '\`' ) && ( lPos == 0 || *(szText+lPos-1) != '\\' ) ) { State = STATE_QUOTE1; lPos++; @@ -2613,6 +2621,7 @@ static int md_strAt( char * szSub, int lSubLen, char * szText, BOOL checkword, B else if( *(szText+lPos) == '[' && ( lPos == 0 || *(szText+lPos-1) != '\\' ) ) { State = STATE_QUOTE3; + kolSquare++; lPos++; continue; }