diff --git a/harbour/ChangeLog b/harbour/ChangeLog index bc1ed3a7d7..ea2c26a20e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,15 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ +2006-08-08 11:40 UTC+0100 Ryszard Glab + * source/pp/pplib.c + * suppressed preprocessing of empty lines + + * utils/hbpptest/pretest.prg + * added line length to MLCOUNT to correctly count the + number of lines to process + + 2006-08-07 14:00 UTC+0100 Ryszard Glab * source/compiler/harbour.y * fixed to support @funname() syntax in assigments diff --git a/harbour/source/pp/pplib.c b/harbour/source/pp/pplib.c index 4661968a79..6a3e61d518 100644 --- a/harbour/source/pp/pplib.c +++ b/harbour/source/pp/pplib.c @@ -187,17 +187,19 @@ HB_FUNC( __PREPROCESS ) slen = HB_MIN( hb_parclen( 1 ), HB_PP_STR_SIZE - 1 ); memcpy( pText, hb_parc( 1 ), slen ); pText[ slen ] = 0; /* Preprocessor expects null-terminated string */ - memset( pOut, 0, HB_PP_STR_SIZE ); - - HB_SKIPTABSPACES( ptr ); - - if( !hb_pp_topDefine ) - hb_pp_Table(); - if( hb_pp_ParseExpression( ptr, pOut, FALSE ) > 0 ) + if( slen ) { - /* Some error here? */ - } + memset( pOut, 0, HB_PP_STR_SIZE ); + HB_SKIPTABSPACES( ptr ); + + if( !hb_pp_topDefine ) + hb_pp_Table(); + if( *ptr && hb_pp_ParseExpression( ptr, pOut, FALSE ) > 0 ) + { + /* Some error here? */ + } + } hb_retc( pText ); /* Preprocessor returns parsed line in input buffer */ } /* else diff --git a/harbour/utils/hbpptest/pretest.prg b/harbour/utils/hbpptest/pretest.prg index 3c423e3de4..87a2cbeaf3 100644 --- a/harbour/utils/hbpptest/pretest.prg +++ b/harbour/utils/hbpptest/pretest.prg @@ -1223,7 +1223,7 @@ FUNCTION PreRun( in, pre ) LOCAL len, i, cin, cout LOCAL out:='' - len := MLCOUNT( in ) + len := MLCOUNT( in, 1024 ) FOR i:=1 TO len cin := ALLTRIM( MEMOLINE(in, 1024, i) ) out += __PreProcess( cin )