diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 37d8d1e47d..e44b61f9f7 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,10 @@ +2000-06-17 13:38 UTC-0800 Ron Pinkas + * source/pp/ppcore.c + ! Fixed isExpress() to check last charcter of the expression and return false if it is one of these: + ":/*+-%^=(<>". This fixed another problem reported by Brian Hays to do with the VO comaptibility #translates. + + /* We still have to find, why was isExpress() called with only partial expression, this should be fixed. */ + 2000-06-17 17:10 UTC+0500 April White * hbapi.h diff --git a/harbour/source/pp/ppcore.c b/harbour/source/pp/ppcore.c index bf618496c1..7c36e89515 100644 --- a/harbour/source/pp/ppcore.c +++ b/harbour/source/pp/ppcore.c @@ -1473,7 +1473,12 @@ static int WorkMarkers( char ** ptrmp, char ** ptri, char * ptro, int * lenres, { lenreal = stroncpy( expreal, *ptri, ipos-1 ); if( ipos > 1 && isExpres( expreal ) ) - *ptri += lenreal; + { + /* + printf( "Accepted: >%s<\n", expreal ); + */ + *ptri += lenreal; + } else { if( s_numBrackets ) @@ -1705,7 +1710,9 @@ static int getExpReal( char * expreal, char ** ptri, BOOL prlist, int maxrez ) if( expreal != NULL ) { if( *(expreal-1) == ' ' ) { expreal--; lens--; }; + *expreal = '\0'; + /* printf( "\nLen=%i \'%s\'\n", lens, expreal-lens); */ @@ -1716,10 +1723,24 @@ static int getExpReal( char * expreal, char ** ptri, BOOL prlist, int maxrez ) static BOOL isExpres( char * stroka ) { int l1,l2; + HB_TRACE(HB_TR_DEBUG, ("isExpres(%s)", stroka)); + + /* + printf( "Exp: >%s<\n", stroka ); + */ + l1 = strlen( stroka ); l2 = getExpReal( NULL, &stroka, FALSE, HB_PP_STR_SIZE ); + + /* + printf( "Len1: %i Len2: %i RealExp: >%s< Last: %c\n", l1, l2, stroka - l2, ( stroka - l2 )[l1-1] ); + */ + + /* Ron Pinkas modified 2000-06-17 Expression can't be valid if last charcter is one of these: ":/*+-%^=(<>" return ( l1 <= l2 ); + */ + return ( l1 <= l2 && ! IsInStr( ( stroka - l2 )[l1-1], ":/*+-%^=(<>" ) ); } static BOOL TestOptional( char *ptr1, char *ptr2 )