From 66f19fe13bd3bf52e2ee019176ac792f155abdca Mon Sep 17 00:00:00 2001 From: Ryszard Glab Date: Mon, 29 May 2006 11:59:37 +0000 Subject: [PATCH] 2006-05-29 14:10 UTC+0100 Ryszard Glab * source/pp/ppcore.c *fixed invalid memory access * source/compiler/harbour.c *fixed to generate error in cases when variable name is duplicated in PARAMETERS and PRIVATE statements (NOTICE: this error is generated when automatic memvar declaration was requested only using -a command line switch) --- harbour/ChangeLog | 11 +++++++++++ harbour/source/compiler/harbour.c | 2 ++ harbour/source/pp/ppcore.c | 14 ++++++++++++-- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b4200becd6..24f9895cef 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,17 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ + + doc/howtorel.txt + + How-to-Release document by Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * doc/whatsnew.txt + + Add tag information to all tagged builds. + + + * harbour.spec + * doc/whatsnew.txt + * include/hbver.h + * modified to store build number 46 + 2006-05-29 14:10 UTC+0100 Ryszard Glab in PARAMETERS and PRIVATE statements (NOTICE: this error is diff --git a/harbour/source/compiler/harbour.c b/harbour/source/compiler/harbour.c index a507cfefd5..cbdf0c58af 100644 --- a/harbour/source/compiler/harbour.c +++ b/harbour/source/compiler/harbour.c @@ -931,6 +931,8 @@ void hb_compVariableAdd( char * szVarName, BYTE cValueType ) pFunc->pMemvars = pVar; else { + hb_compCheckDuplVars( pFunc->pMemvars, szVarName ); + pLastVar = pFunc->pMemvars; while( pLastVar->pNext ) pLastVar = pLastVar->pNext; diff --git a/harbour/source/pp/ppcore.c b/harbour/source/pp/ppcore.c index f4f0442dab..d613e1acea 100644 --- a/harbour/source/pp/ppcore.c +++ b/harbour/source/pp/ppcore.c @@ -2863,6 +2863,10 @@ static int getExpReal( char *expreal, char **ptri, BOOL prlist, int maxrez, BOOL StBr3++; State = STATE_BRACKET; } + else if( **ptri == '}' && StBr3 == 0 ) + { + rez = TRUE; + } else if( **ptri == ',' ) { if( !prlist ) @@ -3185,7 +3189,7 @@ static void SearnRep( char *exppatt, char *expreal, int lenreal, char *ptro, int { bFound = TRUE; rezs = FALSE; - ptr = ptrOut + ifou - 2; + ptr = ptrOut + ifou - 1; kolmarkers = 0; ptr = PrevSquare( ptr, ptro, &kolmarkers ); if( ptr ) @@ -3757,7 +3761,13 @@ int hb_pp_RdStr( FILE * handl_i, char *buffer, int maxlen, BOOL lContinue, char s_ParseState = STATE_NORMAL; } - readed++; + if( maxlen ) + { + if( readed < maxlen ) + readed++; + } + else + readed++; buffer[readed] = '\0'; #if 0