From 076082265a3e79dbd71a9e12d99dd58bbbd7385e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 8 Sep 2006 12:47:27 +0000 Subject: [PATCH] 2006-09-05 15:51 UTC+0100 Viktor Szakats (viktor.szakats syenar.hu) * harbour/include/hbset.h * harbour/include/set.ch * harbour/source/pp/pptable.c * harbour/source/rtl/set.c + Added Set( _SET_DEFEXTENSIONS, ) Default value is .T. (CA-Cl*pper compatible). If set to .F., Harbour runtime/RDD code will never attempt to add a default extension to the filename arguments. Commands/functions where this setting makes a difference are: - SET ALTERNATE TO / Set( _SET_ALTFILE_, ... ) - SET PRINTER TO / Set( _SET_PRINTFILE_, ... ) - Set( _SET_EXTRAFILE, ... ) - SAVE TO / __mvSave() - RESTORE FROM / __mvRestore() - LABEL FORM - REPORT FORM - COPY TO ... DELIMITED - COPY TO ... SDF - LIST / __dbList() - USE / dbUseArea() - dbCreate() - SET INDEX TO / ordListAdd() (not yet implemented) - __HRBLOAD(), __HRBRUN() ; Notes: - From now on, it possible to create/load files using the above functions/commands which have no extension. This might be desirable in a few platform and/or situations. For example on Win32, it's possible to directly print to a shared Windows printer queue, using these commands: lOldValue := Set( _SET_DEFEXTENSIONS, .F. ) SET PRINTER TO \\myserver\myprinter Set( _SET_DEFEXTENSIONS, lOldValue ) Or, it is possible to open a dbf file which has no extension: dbUseArea(.T., NIL, "dbf_filename_with_no_extension", "w_DATA", .F., .F.) - Compiler is (of course) not affected by this setting. - Preprocessor (PP) lib flavour is not affected by this setting. - Support is not full in the RDD code yet. * harbour/source/rdd/dbf1.c * harbour/source/rdd/dblist.prg * harbour/source/rdd/delim1.c * harbour/source/rdd/sdf1.c * harbour/source/rtl/tlabel.prg * harbour/source/rtl/treport.prg * harbour/source/rtl/set.c * harbour/source/vm/memvars.c * harbour/source/vm/runner.c + Honoring _SET_DEFEXTENSIONS setting all over the code. --- harbour/ChangeLog | 50 ++++++++++++ harbour/include/hbset.h | 4 +- harbour/include/set.ch | 143 +++++++++++++++++---------------- harbour/source/pp/pptable.c | 3 +- harbour/source/rdd/dbf1.c | 4 +- harbour/source/rdd/dblist.prg | 2 +- harbour/source/rdd/delim1.c | 4 +- harbour/source/rdd/sdf1.c | 4 +- harbour/source/rtl/set.c | 9 ++- harbour/source/rtl/tlabel.prg | 8 +- harbour/source/rtl/treport.prg | 8 +- harbour/source/vm/memvars.c | 4 +- harbour/source/vm/runner.c | 9 ++- 13 files changed, 158 insertions(+), 94 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b034f90949..3e62114f76 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -42,6 +42,56 @@ * harbour/source/vm/fm.c ! fixed typo in memset() when HB_PARANOID_MEM_CHECK enabled + * harbour/source/vm/hvm.c + ! fixed item type used for iterator + +2006-09-06 12:02 UTC+0300 Chen Kedem + * utils/hbrun/hbrun.prg + * Change Main() into _APPMAIN() to avoid collision with user function + Default value is .T. (CA-Cl*pper compatible). If set to .F., + Harbour runtime/RDD code will never attempt to add a + default extension to the filename arguments. Commands/functions +2006-09-05 16:10 UTC+0300 Alexander Kresin + * source/rtl/cdpapi.c + ! Bug fixed in hb_cdpcmp(), which caused strange comparison results as + ( s1 > s2 ) != ( s2 > s1 ). + +2006-09-05 15:51 UTC+0100 Viktor Szakats (viktor.szakats syenar.hu) + * harbour/include/hbset.h + * harbour/include/set.ch + * harbour/source/pp/pptable.c + * harbour/source/rtl/set.c + + Added Set( _SET_DEFEXTENSIONS, ) + Default value is .T. (CA-Cl*pper compatible). If set to .F., + Harbour runtime/RDD code will never attempt to add a + default extension to the filename arguments. Commands/functions + where this setting makes a difference are: + - SET ALTERNATE TO / Set( _SET_ALTFILE_, ... ) + - From now on, it possible to create/load files using the + above functions/commands which have no extension. This + - SAVE TO / __mvSave() + For example on Win32, it's possible to directly print + - LABEL FORM + - REPORT FORM + - COPY TO ... DELIMITED + - COPY TO ... SDF + - LIST / __dbList() + - USE / dbUseArea() + - dbCreate() + - SET INDEX TO / ordListAdd() (not yet implemented) + - __HRBLOAD(), __HRBRUN() + ; Notes: + - From now on, it possible to create/load files using the + above functions/commands which have no extension. This + might be desirable in a few platform and/or situations. + For example on Win32, it's possible to directly print + to a shared Windows printer queue, using these commands: + lOldValue := Set( _SET_DEFEXTENSIONS, .F. ) + SET PRINTER TO \\myserver\myprinter + Set( _SET_DEFEXTENSIONS, lOldValue ) + Or, it is possible to open a dbf file which has no extension: + dbUseArea(.T., NIL, "dbf_filename_with_no_extension", "w_DATA", .F., .F.) + - Compiler is (of course) not affected by this setting. - Preprocessor (PP) lib flavour is not affected by this setting. - Support is not full in the RDD code yet. diff --git a/harbour/include/hbset.h b/harbour/include/hbset.h index 936fadfa28..5fe7e09148 100644 --- a/harbour/include/hbset.h +++ b/harbour/include/hbset.h @@ -129,7 +129,8 @@ typedef enum HB_SET_EOF = 105, HB_SET_HARDCOMMIT = 106, HB_SET_FORCEOPT = 107, - HB_SET_DBFLOCKSCHEME = 108 + HB_SET_DBFLOCKSCHEME = 108, + HB_SET_DEFEXTENSIONS = 109 } HB_set_enum; @@ -196,6 +197,7 @@ typedef struct int HB_SET_DBFLOCKSCHEME; BOOL HB_SET_HARDCOMMIT; BOOL HB_SET_FORCEOPT; + BOOL HB_SET_DEFEXTENSIONS; } HB_SET_STRUCT; #define HB_SET_CASE_MIXED 0 diff --git a/harbour/include/set.ch b/harbour/include/set.ch index a94673b789..df8e2deb9a 100644 --- a/harbour/include/set.ch +++ b/harbour/include/set.ch @@ -55,76 +55,77 @@ #ifndef _SET_CH #define _SET_CH -#define _SET_EXACT 1 -#define _SET_FIXED 2 -#define _SET_DECIMALS 3 -#define _SET_DATEFORMAT 4 -#define _SET_EPOCH 5 -#define _SET_PATH 6 -#define _SET_DEFAULT 7 - -#define _SET_EXCLUSIVE 8 -#define _SET_SOFTSEEK 9 -#define _SET_UNIQUE 10 -#define _SET_DELETED 11 - -#define _SET_CANCEL 12 -#define _SET_DEBUG 13 -#define _SET_TYPEAHEAD 14 - -#define _SET_COLOR 15 -#define _SET_CURSOR 16 -#define _SET_CONSOLE 17 -#define _SET_ALTERNATE 18 -#define _SET_ALTFILE 19 -#define _SET_DEVICE 20 -#define _SET_EXTRA 21 -#define _SET_EXTRAFILE 22 -#define _SET_PRINTER 23 -#define _SET_PRINTFILE 24 -#define _SET_MARGIN 25 - -#define _SET_BELL 26 -#define _SET_CONFIRM 27 -#define _SET_ESCAPE 28 -#define _SET_INSERT 29 -#define _SET_EXIT 30 -#define _SET_INTENSITY 31 -#define _SET_SCOREBOARD 32 -#define _SET_DELIMITERS 33 -#define _SET_DELIMCHARS 34 - -#define _SET_WRAP 35 -#define _SET_MESSAGE 36 -#define _SET_MCENTER 37 -#define _SET_SCROLLBREAK 38 - -#define _SET_EVENTMASK 39 /* CA-Cl*pper 5.3 compatible */ - -#define _SET_VIDEOMODE 40 /* CA-Cl*pper 5.3 compatible */ - -#define _SET_MBLOCKSIZE 41 /* CA-Cl*pper 5.3 compatible */ -#define _SET_MFILEEXT 42 /* CA-Cl*pper 5.3 compatible */ - -#define _SET_STRICTREAD 43 /* CA-Cl*pper 5.3 compatible */ -#define _SET_OPTIMIZE 44 /* CA-Cl*pper 5.3 compatible */ -#define _SET_AUTOPEN 45 /* CA-Cl*pper 5.3 compatible */ -#define _SET_AUTORDER 46 /* CA-Cl*pper 5.3 compatible */ -#define _SET_AUTOSHARE 47 /* CA-Cl*pper 5.3 compatible */ - -#define _SET_COUNT 47 - -#define _SET_LANGUAGE 100 /* Harbour extension */ -#define _SET_IDLEREPEAT 101 /* Harbour extension */ -#define _SET_FILECASE 102 /* Harbour extension */ -#define _SET_DIRCASE 103 /* Harbour extension */ -#define _SET_DIRSEPARATOR 104 /* Harbour extension */ -#define _SET_EOF 105 /* Harbour extension */ -#define _SET_HARDCOMMIT 106 /* Harbour extension */ -#define _SET_FORCEOPT 107 /* Harbour extension */ -#define _SET_DBFLOCKSCHEME 108 /* Harbour extension */ - -#define HB_SET_BASE 100 -#define HB_SET_COUNT 9 +#define _SET_EXACT 1 +#define _SET_FIXED 2 +#define _SET_DECIMALS 3 +#define _SET_DATEFORMAT 4 +#define _SET_EPOCH 5 +#define _SET_PATH 6 +#define _SET_DEFAULT 7 + +#define _SET_EXCLUSIVE 8 +#define _SET_SOFTSEEK 9 +#define _SET_UNIQUE 10 +#define _SET_DELETED 11 + +#define _SET_CANCEL 12 +#define _SET_DEBUG 13 +#define _SET_TYPEAHEAD 14 + +#define _SET_COLOR 15 +#define _SET_CURSOR 16 +#define _SET_CONSOLE 17 +#define _SET_ALTERNATE 18 +#define _SET_ALTFILE 19 +#define _SET_DEVICE 20 +#define _SET_EXTRA 21 +#define _SET_EXTRAFILE 22 +#define _SET_PRINTER 23 +#define _SET_PRINTFILE 24 +#define _SET_MARGIN 25 + +#define _SET_BELL 26 +#define _SET_CONFIRM 27 +#define _SET_ESCAPE 28 +#define _SET_INSERT 29 +#define _SET_EXIT 30 +#define _SET_INTENSITY 31 +#define _SET_SCOREBOARD 32 +#define _SET_DELIMITERS 33 +#define _SET_DELIMCHARS 34 + +#define _SET_WRAP 35 +#define _SET_MESSAGE 36 +#define _SET_MCENTER 37 +#define _SET_SCROLLBREAK 38 + +#define _SET_EVENTMASK 39 /* CA-Cl*pper 5.3 compatible */ + +#define _SET_VIDEOMODE 40 /* CA-Cl*pper 5.3 compatible */ + +#define _SET_MBLOCKSIZE 41 /* CA-Cl*pper 5.3 compatible */ +#define _SET_MFILEEXT 42 /* CA-Cl*pper 5.3 compatible */ + +#define _SET_STRICTREAD 43 /* CA-Cl*pper 5.3 compatible */ +#define _SET_OPTIMIZE 44 /* CA-Cl*pper 5.3 compatible */ +#define _SET_AUTOPEN 45 /* CA-Cl*pper 5.3 compatible */ +#define _SET_AUTORDER 46 /* CA-Cl*pper 5.3 compatible */ +#define _SET_AUTOSHARE 47 /* CA-Cl*pper 5.3 compatible */ + +#define _SET_COUNT 47 + +#define _SET_LANGUAGE 100 /* Harbour extension */ +#define _SET_IDLEREPEAT 101 /* Harbour extension */ +#define _SET_FILECASE 102 /* Harbour extension */ +#define _SET_DIRCASE 103 /* Harbour extension */ +#define _SET_DIRSEPARATOR 104 /* Harbour extension */ +#define _SET_EOF 105 /* Harbour extension */ +#define _SET_HARDCOMMIT 106 /* Harbour extension */ +#define _SET_FORCEOPT 107 /* Harbour extension */ +#define _SET_DBFLOCKSCHEME 108 /* Harbour extension */ +#define _SET_DEFEXTENSIONS 109 /* Harbour extension */ + +#define HB_SET_BASE 100 +#define HB_SET_COUNT 10 #endif /* _SET_CH */ diff --git a/harbour/source/pp/pptable.c b/harbour/source/pp/pptable.c index dbb895782a..27fcc4680e 100644 --- a/harbour/source/pp/pptable.c +++ b/harbour/source/pp/pptable.c @@ -128,6 +128,7 @@ void hb_pp_Table( void ) static DEFINES sD___57 = {"_SET_HARDCOMMIT", 15,NULL,-1,"106", &sD___56 }; static DEFINES sD___58 = {"_SET_FORCEOPT", 13,NULL,-1,"107", &sD___57 }; static DEFINES sD___59 = {"_SET_DBFLOCKSCHEME", 18,NULL,-1,"108", &sD___58 }; + static DEFINES sD___60 = {"_SET_DEFEXTENSIONS", 18,NULL,-1,"109", &sD___59 }; static COMMANDS sC___1 = {0,"NOTE", 4,"\1A30",NULL,NULL }; static COMMANDS sC___2 = {0,"DO",2,"WHILE \1A00","while \1A00",&sC___1 }; @@ -450,7 +451,7 @@ void hb_pp_Table( void ) static COMMANDS sC___262 = {0,"SET",3,"DBFLOCKSCHEME TO \1A00","Set(_SET_DBFLOCKSCHEME, \1A00 )",&sC___261 }; static COMMANDS sC___263 = {0,"SET",3,"DBFLOCKSCHEME TO","Set(_SET_DBFLOCKSCHEME, 0 )",&sC___262 }; - hb_pp_topDefine = &sD___59; + hb_pp_topDefine = &sD___60; hb_pp_topCommand = &sC___263; hb_pp_topTranslate = NULL; } diff --git a/harbour/source/rdd/dbf1.c b/harbour/source/rdd/dbf1.c index a2bbecef3a..716192783a 100644 --- a/harbour/source/rdd/dbf1.c +++ b/harbour/source/rdd/dbf1.c @@ -2154,7 +2154,7 @@ static ERRCODE hb_dbfCreate( DBFAREAP pArea, LPDBOPENINFO pCreateInfo ) HB_TRACE(HB_TR_DEBUG, ("hb_dbfCreate(%p, %p)", pArea, pCreateInfo)); pFileName = hb_fsFNameSplit( ( char * ) pCreateInfo->abName ); - if( ! pFileName->szExtension ) + if( hb_set.HB_SET_DEFEXTENSIONS && ! pFileName->szExtension ) { pItem = hb_itemPutC( pItem, "" ); if( SELF_INFO( ( AREAP ) pArea, DBI_TABLEEXT, pItem ) != SUCCESS ) @@ -2921,7 +2921,7 @@ static ERRCODE hb_dbfOpen( DBFAREAP pArea, LPDBOPENINFO pOpenInfo ) pFileName = hb_fsFNameSplit( ( char * ) pOpenInfo->abName ); /* Add default file name extension if necessary */ - if( ! pFileName->szExtension ) + if( hb_set.HB_SET_DEFEXTENSIONS && ! pFileName->szExtension ) { pFileExt = hb_itemPutC( NULL, "" ); if( SELF_INFO( ( AREAP ) pArea, DBI_TABLEEXT, pFileExt ) != SUCCESS ) diff --git a/harbour/source/rdd/dblist.prg b/harbour/source/rdd/dblist.prg index 54092413fe..feddbb83dc 100644 --- a/harbour/source/rdd/dblist.prg +++ b/harbour/source/rdd/dblist.prg @@ -84,7 +84,7 @@ PROCEDURE __dbList( lOff, abEval, lAll, bFor, bWhile, nNext, nRecord, lRest, lTo ENDIF IF !Empty( cToFileName ) hb_FNameSplit( cToFileName, @cPath, @cName, @cExt ) - IF Empty( cExt ) + IF Set( _SET_DEFEXTENSIONS ) .AND. Empty( cExt ) cExt := ".txt" ENDIF lOldExtra := Set( _SET_EXTRA, .T. ) diff --git a/harbour/source/rdd/delim1.c b/harbour/source/rdd/delim1.c index 7fabb686e2..7ff6782a01 100644 --- a/harbour/source/rdd/delim1.c +++ b/harbour/source/rdd/delim1.c @@ -1213,7 +1213,7 @@ static ERRCODE hb_delimCreate( DELIMAREAP pArea, LPDBOPENINFO pCreateInfo ) #endif pFileName = hb_fsFNameSplit( ( char * ) pCreateInfo->abName ); - if( ! pFileName->szExtension ) + if( hb_set.HB_SET_DEFEXTENSIONS && ! pFileName->szExtension ) { PHB_ITEM pItem = hb_itemPutC( NULL, "" ); SELF_INFO( ( AREAP ) pArea, DBI_TABLEEXT, pItem ); @@ -1305,7 +1305,7 @@ static ERRCODE hb_delimOpen( DELIMAREAP pArea, LPDBOPENINFO pOpenInfo ) pFileName = hb_fsFNameSplit( ( char * ) pOpenInfo->abName ); /* Add default file name extension if necessary */ - if( ! pFileName->szExtension ) + if( hb_set.HB_SET_DEFEXTENSIONS && ! pFileName->szExtension ) { PHB_ITEM pFileExt = hb_itemPutC( NULL, "" ); SELF_INFO( ( AREAP ) pArea, DBI_TABLEEXT, pFileExt ); diff --git a/harbour/source/rdd/sdf1.c b/harbour/source/rdd/sdf1.c index 5af00ab431..3ac980d1d3 100644 --- a/harbour/source/rdd/sdf1.c +++ b/harbour/source/rdd/sdf1.c @@ -945,7 +945,7 @@ static ERRCODE hb_sdfCreate( SDFAREAP pArea, LPDBOPENINFO pCreateInfo ) #endif pFileName = hb_fsFNameSplit( ( char * ) pCreateInfo->abName ); - if( ! pFileName->szExtension ) + if( hb_set.HB_SET_DEFEXTENSIONS && ! pFileName->szExtension ) { PHB_ITEM pItem = hb_itemPutC( NULL, "" ); SELF_INFO( ( AREAP ) pArea, DBI_TABLEEXT, pItem ); @@ -1037,7 +1037,7 @@ static ERRCODE hb_sdfOpen( SDFAREAP pArea, LPDBOPENINFO pOpenInfo ) pFileName = hb_fsFNameSplit( ( char * ) pOpenInfo->abName ); /* Add default file name extension if necessary */ - if( ! pFileName->szExtension ) + if( hb_set.HB_SET_DEFEXTENSIONS && ! pFileName->szExtension ) { PHB_ITEM pFileExt = hb_itemPutC( NULL, "" ); SELF_INFO( ( AREAP ) pArea, DBI_TABLEEXT, pFileExt ); diff --git a/harbour/source/rtl/set.c b/harbour/source/rtl/set.c index cf044a5c17..d8b8d11706 100644 --- a/harbour/source/rtl/set.c +++ b/harbour/source/rtl/set.c @@ -229,9 +229,9 @@ static FHANDLE open_handle( char * file_name, BOOL bAppend, char * def_ext, HB_s { pFilename = hb_fsFNameSplit( file_name ); - if( ! pFilename->szPath && hb_set.HB_SET_DEFAULT ) + if( pFilename->szPath == NULL && hb_set.HB_SET_DEFAULT ) pFilename->szPath = hb_set.HB_SET_DEFAULT; - if( ! pFilename->szExtension && def_ext ) + if( hb_set.HB_SET_DEFEXTENSIONS && pFilename->szExtension == NULL && def_ext ) pFilename->szExtension = def_ext; hb_fsFNameMerge( path, pFilename ); @@ -877,6 +877,10 @@ HB_FUNC( SET ) } } break; + case HB_SET_DEFEXTENSIONS: + hb_retni( hb_set.HB_SET_DEFEXTENSIONS ); + if( args > 1 ) hb_set.HB_SET_DEFEXTENSIONS = set_logical( pArg2, hb_set.HB_SET_DEFEXTENSIONS ); + break; case HB_SET_INVALID_: /* Return NIL if called with invalid SET specifier */ break; @@ -979,6 +983,7 @@ void hb_setInitialize( void ) hb_set.HB_SET_VIDEOMODE = 0; hb_set.HB_SET_WRAP = FALSE; hb_set.HB_SET_DBFLOCKSCHEME = 0; + hb_set.HB_SET_DEFEXTENSIONS = TRUE; sp_sl_first = sp_sl_last = NULL; s_next_listener = 1; diff --git a/harbour/source/rtl/tlabel.prg b/harbour/source/rtl/tlabel.prg index 22b3718f62..18b6c48957 100644 --- a/harbour/source/rtl/tlabel.prg +++ b/harbour/source/rtl/tlabel.prg @@ -137,9 +137,11 @@ METHOD New( cLBLName, lPrinter, cAltFile, lNoConsole, bFor, ; Eval(ErrorBlock(), err) ELSE cLBLName := RTrim( cLBLName ) // ; TOFIX: Not very multiplatform. - hb_FNameSplit( cLBLName, NIL, NIL, @cExt ) - IF Empty( cExt ) - cLBLName += ".lbl" + IF Set( _SET_DEFEXTENSIONS ) + hb_FNameSplit( cLBLName, NIL, NIL, @cExt ) + IF Empty( cExt ) + cLBLName += ".lbl" + ENDIF ENDIF ENDIF diff --git a/harbour/source/rtl/treport.prg b/harbour/source/rtl/treport.prg index 38d588de9a..d11f2131ed 100644 --- a/harbour/source/rtl/treport.prg +++ b/harbour/source/rtl/treport.prg @@ -198,9 +198,11 @@ METHOD NEW(cFrmName,lPrinter,cAltFile,lNoConsole,bFor,bWhile,nNext,nRecord,; Eval(ErrorBlock(), err) ELSE cFRMName := RTrim( cFRMName ) // ; TOFIX: Not very multiplatform. - hb_FNameSplit( cFRMName, NIL, NIL, @cExt ) - IF Empty( cExt ) - cFRMName += ".frm" + IF Set( _SET_DEFEXTENSIONS ) + hb_FNameSplit( cFRMName, NIL, NIL, @cExt ) + IF Empty( cExt ) + cFRMName += ".frm" + ENDIF ENDIF ENDIF diff --git a/harbour/source/vm/memvars.c b/harbour/source/vm/memvars.c index 9389df38bf..931a18f7bc 100644 --- a/harbour/source/vm/memvars.c +++ b/harbour/source/vm/memvars.c @@ -1353,7 +1353,7 @@ HB_FUNC( __MVSAVE ) pFileName = hb_fsFNameSplit( hb_parc( 1 ) ); - if( pFileName->szExtension == NULL ) + if( hb_set.HB_SET_DEFEXTENSIONS && pFileName->szExtension == NULL ) pFileName->szExtension = ".mem"; if( pFileName->szPath == NULL ) @@ -1423,7 +1423,7 @@ HB_FUNC( __MVRESTORE ) pFileName = hb_fsFNameSplit( hb_parc( 1 ) ); - if( pFileName->szExtension == NULL ) + if( hb_set.HB_SET_DEFEXTENSIONS && pFileName->szExtension == NULL ) pFileName->szExtension = ".mem"; if( pFileName->szPath == NULL ) diff --git a/harbour/source/vm/runner.c b/harbour/source/vm/runner.c index 15261085dc..dc76adc3ab 100644 --- a/harbour/source/vm/runner.c +++ b/harbour/source/vm/runner.c @@ -4,7 +4,7 @@ /* * Harbour Project source code: - * Harbour Portable Object (.HRB) file runner + * Harbour Portable Object (.hrb) file runner * * Copyright 1999 Eddie Runia * www - http://www.harbour-project.org @@ -68,6 +68,7 @@ #include "hbapifs.h" #include "hbvm.h" #include "hbpcode.h" +#include "hbset.h" #include "hb_io.h" /* TODO: Fill the error codes with valid ones (instead of 9999) */ @@ -339,7 +340,7 @@ static PHRB_BODY hb_hrbLoad( char* szHrbBody, ULONG ulBodySize ) pSymRead = ( PHB_SYMB ) hb_xgrab( pHrbBody->ulSymbols * sizeof( HB_SYMB ) ); - for( ul = 0; ul < pHrbBody->ulSymbols; ul++ ) /* Read symbols in .HRB */ + for( ul = 0; ul < pHrbBody->ulSymbols; ul++ ) /* Read symbols in .hrb */ { pSymRead[ ul ].szName = hb_hrbReadId( szHrbBody, ulBodySize, &ulBodyOffset ); if( pSymRead[ ul ].szName == NULL || ulBodyOffset + 2 > ulBodySize ) @@ -488,7 +489,7 @@ static PHRB_BODY hb_hrbLoadFromFile( char* szHrb ) /* Create full filename */ pFileName = hb_fsFNameSplit( szHrb ); - if( ! pFileName->szExtension ) + if( hb_set.HB_SET_DEFEXTENSIONS && pFileName->szExtension == NULL ) { pFileName->szExtension = ".hrb"; } @@ -564,7 +565,7 @@ static void hb_hrbDo( PHRB_BODY pHrbBody, int argc, char * argv[] ) /* __HRBRUN( [, xParam1 [, xParamN ] ] ) -> return value. - This program will get the data from the .HRB file and run the p-code + This program will get the data from the .hrb file and run the p-code contained in it. In due time it should also be able to collect the data from the