diff --git a/harbour/ChangeLog b/harbour/ChangeLog index e59717f566..e1796ef2a6 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,15 @@ +19990917-00:50 GMT+1 Victor Szel + + * source/rtl/hardcr.c + ! Fixed so that it doesn't modify the buffer returned by hb_parc(), + it now uses Item API calls. + * source/hbpp/stdalone/hbpp.c + + Enhanced header. + * source/runner/stdalone/runner.prg + + Enhanced header. + * source/runner/runlib.c + + __HRBRUN() will now add default extension (.hrb) to the passed filename. + 19990917-00:05 GMT+1 Victor Szel * include/hbdefs.h diff --git a/harbour/source/hbpp/stdalone/hbpp.c b/harbour/source/hbpp/stdalone/hbpp.c index d71de24729..5ab53a4834 100644 --- a/harbour/source/hbpp/stdalone/hbpp.c +++ b/harbour/source/hbpp/stdalone/hbpp.c @@ -51,6 +51,7 @@ #include #include "hbpp.h" #include "hberrors.h" +#include "hbver.h" extern int pp_strAt( char *, int, char *, int ); extern void pp_Stuff( char *, char *, int, int, int ); @@ -77,7 +78,10 @@ int main( int argc, char * argv[] ) DEFINES * stdef = topDefine; COMMANDS * stcmd = topCommand; - printf( "Harbour preprocessor\n" ); + printf( "Harbour Preprocessor, Build %i%s (%04d.%02d.%02d)\n", + hb_build, hb_revision, hb_year, hb_month, hb_day ); + printf( "Copyright 1999, http://www.harbour-project.org\n" ); + while( iArg < argc ) { if( IS_OPT_SEP(argv[ iArg ][ 0 ])) @@ -142,13 +146,14 @@ int main( int argc, char * argv[] ) } else { - printf( "Syntax: hbpp [options]\n" - "\nOptions: \n" - "\t/d[=]\t#define \n" - "\t/i\tadd #include file search path\n" - "\t/o\t\tcreates hbpp.out with all tables\n" - "\t/n\t\twith those only, which defined in your file\n" - "\t/w\t\tenable warnings\n" ); + printf( "\nSyntax: %s [options]" + "\n" + "\nOptions: /d[=] #define " + "\n /i add #include file search path" + "\n /o creates hbpp.out with all tables" + "\n /n with those only, which defined in your file" + "\n /w enable warnings" + , argv[ 0 ] ); if( bOutTable ) OutTable( NULL, NULL ); diff --git a/harbour/source/rtl/hardcr.c b/harbour/source/rtl/hardcr.c index f0f6b5ef13..cb1b466d2e 100644 --- a/harbour/source/rtl/hardcr.c +++ b/harbour/source/rtl/hardcr.c @@ -65,6 +65,7 @@ */ #include "extend.h" +#include "itemapi.h" #define CHR_HARD1 ( ( char ) 13 ) @@ -89,11 +90,16 @@ char * hb_strHardCR( char * pszString, ULONG ulStringLen ) HARBOUR HB_HARDCR( void ) { - if( ISCHAR( 1 ) ) - { - ULONG ulStringLen = hb_parclen( 1 ); + PHB_ITEM pString = hb_param( 1, IT_STRING ); - hb_retclen( hb_strHardCR( hb_parc( 1 ), ulStringLen ), ulStringLen ); + if( pString ) + { + char * pszBuffer = hb_itemGetC( pString ); + ULONG ulStringLen = hb_itemGetCLen( pString ); + + hb_retclen( hb_strHardCR( pszBuffer, ulStringLen ), ulStringLen ); + + hb_itemFreeC( pszBuffer ); } else hb_retc( "" ); diff --git a/harbour/source/runner/runlib.c b/harbour/source/runner/runlib.c index ab271ec12b..fb4f48a321 100644 --- a/harbour/source/runner/runlib.c +++ b/harbour/source/runner/runlib.c @@ -36,6 +36,7 @@ #include "extend.h" #include "itemapi.h" #include "errorapi.h" +#include "filesys.h" #include "ctoharb.h" #include "pcode.h" @@ -128,10 +129,22 @@ HARBOUR HB___HRBRUN( void ) { if( hb_pcount() >= 1 ) { - char * szFileName = hb_parc( 1 ); + char szFileName[ _POSIX_PATH_MAX + 1 ]; + PHB_FNAME pFileName; FILE * file; BOOL bError = FALSE; + /* Create full filename */ + + pFileName = hb_fsFNameSplit( hb_parc( 1 ) ); + + if( ! pFileName->szExtension ) + pFileName->szExtension = ".hrb"; + + hb_fsFNameMerge( szFileName, pFileName ); + + hb_xfree( pFileName ); + /* Open as binary */ while ( ( file = hb_hrbFileOpen( szFileName ) ) == NULL ) diff --git a/harbour/source/runner/stdalone/runner.prg b/harbour/source/runner/stdalone/runner.prg index 003bcd6ba4..d1b9d99a6e 100644 --- a/harbour/source/runner/stdalone/runner.prg +++ b/harbour/source/runner/stdalone/runner.prg @@ -39,11 +39,13 @@ FUNCTION Main( cHRBFile, cPar1, cPar2, cPar3, cPar4, cPar5, cPar6, cPar7, cPar8, LOCAL xRetVal IF Empty( cHRBFile ) - ?? "Syntax: runner [parameter]" + ?? "Harbour Runner" + ? "Copyright 1999, http://www.harbour-project.org" ? + ? "Syntax: runner [parameters]" ELSE xRetVal := __hrbRun( cHRBFile, cPar1, cPar2, cPar3, cPar4, cPar5, cPar6, cPar7, cPar8, cPar9 ) ENDIF -RETURN xRetVal + RETURN xRetVal