From cfd7a8d111e82a65bb97d6a76d1662ae139ab510 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 18 Oct 1999 10:14:12 +0000 Subject: [PATCH] 19991018-11:58 GMT+1 --- harbour/ChangeLog | 16 ++++++++++++++++ harbour/source/rtl/adir.prg | 16 +++++++++++----- harbour/source/rtl/asort.prg | 4 ++-- harbour/source/rtl/dir.c | 4 ++++ harbour/source/rtl/fm.c | 2 +- harbour/source/rtl/soundex.c | 4 ++-- harbour/tests/rtl_test.prg | 6 +++--- 7 files changed, 39 insertions(+), 13 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c5a57e482d..dcc4a8f7ca 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,19 @@ +19991018-11:58 GMT+1 Victor Szel + * source/rtl/adir.prg + + SET DEFAULT handling added. + * source/rtl/dir.c + + TOFIX: added to change to filename splitting/merging to use the + hb_FName*() functions. That's why DIRECTORY() will GPF now on some + systems (WinNT/MINGW32/normal slash in directory). + * tests/rtl_test.prg + ! Small fixes for some time parameters. + * source/rtl/soundex.c + ! Small pedantic fix. + * source/rtl/fm.c + * TODO text modified. + * source/rtl/asort.prg + * Small change. + 19991018-09:36 GMT+1 Antonio Linares * source/rtl/gt/gtwin.c + Added support for Windows apps without console. diff --git a/harbour/source/rtl/adir.prg b/harbour/source/rtl/adir.prg index f7bfac68dd..53c17c55f4 100644 --- a/harbour/source/rtl/adir.prg +++ b/harbour/source/rtl/adir.prg @@ -36,7 +36,7 @@ #include "common.ch" #include "directry.ch" -FUNCTION aDir( cFileMask, aName, aSize, aDate, aTime, aAttr ) +FUNCTION ADir( cFileMask, aName, aSize, aDate, aTime, aAttr ) LOCAL aDir LOCAL nDirLen @@ -46,17 +46,23 @@ FUNCTION aDir( cFileMask, aName, aSize, aDate, aTime, aAttr ) LOCAL aFileInfo + LOCAL cDir + LOCAL cName + LOCAL cExt + // ; CA-Clipper would fail on this case. IF !ISCHARACTER( cFileMask ) RETURN 0 ENDIF - // ; + // ; If no drive/dir specified, use the SET DEFAULT setting. - /* TODO: Some portable code should be added here, which would */ - /* use the drive + dir from Set( _SET_DEFAULT ) if there */ - /* was none specified in cFileMask */ + hb_FNameSplit( cFileMask, @cDir, @cName, @cExt ) + + IF Empty( cDir ) + cFileMask := hb_FNameMerge( DefPath(), cName, cExt ) + ENDIF // ; diff --git a/harbour/source/rtl/asort.prg b/harbour/source/rtl/asort.prg index ccd5857b12..f4fb129fcc 100644 --- a/harbour/source/rtl/asort.prg +++ b/harbour/source/rtl/asort.prg @@ -36,11 +36,11 @@ #include "common.ch" /* - * aSort( , [], [], [] ) + * ASort( , [], [], [] ) * * Sort an array */ -FUNCTION aSort( aArray, nStart, nCount, bBlock ) +FUNCTION ASort( aArray, nStart, nCount, bBlock ) IF !ISARRAY( aArray ) RETURN NIL diff --git a/harbour/source/rtl/dir.c b/harbour/source/rtl/dir.c index 50778b9ea3..eeebf0e059 100644 --- a/harbour/source/rtl/dir.c +++ b/harbour/source/rtl/dir.c @@ -33,6 +33,10 @@ * */ +/* TOFIX: Filename/path splitting and merging should be rewritten to use + hb_FName*() functions, instead of repeating the functionality + in the current partially buggy way. */ + /* * DIR.C: Returns a Harbour array of specified directory contents filtered * by the optional file and attribute mask. diff --git a/harbour/source/rtl/fm.c b/harbour/source/rtl/fm.c index 0e029282f8..6439a756a6 100644 --- a/harbour/source/rtl/fm.c +++ b/harbour/source/rtl/fm.c @@ -240,7 +240,7 @@ void * hb_xmemset( void * pDestArg, int iFill, ULONG ulLen ) HARBOUR HB_MEMORY( void ) { - /* TODO: Implement */ + /* TODO: Implement MEMORY() */ hb_retni( 9999 ); } diff --git a/harbour/source/rtl/soundex.c b/harbour/source/rtl/soundex.c index 629efe4d53..5fe91ca819 100644 --- a/harbour/source/rtl/soundex.c +++ b/harbour/source/rtl/soundex.c @@ -57,13 +57,13 @@ HARBOUR HB_SOUNDEX( void ) ULONG ulLen = hb_itemGetCLen( pString ); ULONG nPos = 0; ULONG nResultPos = 0; - char cCharPrev = 0; + char cCharPrev = '0'; while( nPos < ulLen && nResultPos < SOUNDEX_LEN_MAX ) { if( isalpha( pszString[ nPos ] ) ) { - /* "ABCDEFGHIJKLMNOPQRSTUVWXYS" */ + /* "ABCDEFGHIJKLMNOPQRSTUVWXYZ" */ static const char s_szTable[] = "01230120022455012623010202"; /* NOTE: SoundEx result codes for letters from "A" to "Z" */ char cChar = toupper( pszString[ nPos ] ); diff --git a/harbour/tests/rtl_test.prg b/harbour/tests/rtl_test.prg index 172a6f72a5..d9ef19e1b3 100644 --- a/harbour/tests/rtl_test.prg +++ b/harbour/tests/rtl_test.prg @@ -1697,14 +1697,14 @@ STATIC FUNCTION Main_MISC() TEST_LINE( DAYS( 100000 ) , 1 ) - TEST_LINE( ELAPTIME("24:12:34","12:34:57") , "12:22:23" ) - TEST_LINE( ELAPTIME("12:34:57","24:12:34") , "11:37:37" ) + TEST_LINE( ELAPTIME("23:12:34","12:34:57") , "13:22:23" ) + TEST_LINE( ELAPTIME("12:34:57","23:12:34") , "10:37:37" ) TEST_LINE( LENNUM( 10 ) , 2 ) TEST_LINE( LENNUM( 10.9 ) , 4 ) TEST_LINE( LENNUM( 10.90 ) , 5 ) - TEST_LINE( SECS("24:12:34") , 87154 ) + TEST_LINE( SECS("23:12:34") , 83554 ) TEST_LINE( SECS("12:34:57") , 45297 ) TEST_LINE( TSTRING(1000) , "00:16:40" )