From 69df442a66311f1d2cd564ef41dc99645bf5aaa3 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 1 May 2000 16:02:51 +0000 Subject: [PATCH] 20000501-18:05 GMT+1 Victor Szakats --- harbour/ChangeLog | 8 ++++++++ harbour/include/hbapi.h | 1 + harbour/source/rtl/filesys.c | 27 ++++++++++++++++++--------- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index af66aaf5b7..50a8ebef4c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,11 @@ +20000501-18:05 GMT+1 Victor Szakats + + * source/rtl/filesys.c + ! Fixed hb_fsCurDirBuff() (and CURDIR()) for non-MINGW32 platforms. + + * include/hbapi.h + + Added missing declaration from the previous CVS. + 20000501-17:42 GMT+1 Victor Szakats * source/vm/cmdarg.c diff --git a/harbour/include/hbapi.h b/harbour/include/hbapi.h index 9594ba7396..47e20ccb60 100644 --- a/harbour/include/hbapi.h +++ b/harbour/include/hbapi.h @@ -509,6 +509,7 @@ extern char * hb_macroGetType( HB_ITEM_PTR ); extern char * hb_verPlatform( void ); extern char * hb_verCompiler( void ); extern char * hb_verHarbour( void ); +extern void hb_verBuildInfo( void ); #if defined(HB_EXTERN_C) } diff --git a/harbour/source/rtl/filesys.c b/harbour/source/rtl/filesys.c index a088bf1cd3..b248bee850 100644 --- a/harbour/source/rtl/filesys.c +++ b/harbour/source/rtl/filesys.c @@ -1140,15 +1140,21 @@ USHORT hb_fsCurDirBuff( USHORT uiDrive, BYTE * pbyBuffer, ULONG ulLen ) #elif defined(__MINGW32__) + errno = 0; + _getdcwd( uiDrive, pbyBuffer, ulLen ); + s_uiErrorLast = errno; + +#else + + s_uiErrorLast = FS_ERROR; + +#endif + + /* Strip the leading drive spec, and leading backslash if there's one. */ + { BYTE * pbyStart = pbyBuffer; - errno = 0; - _getdcwd( uiDrive, pbyBuffer, ulLen ); - s_uiErrorLast = errno; - - /* Strip the leading drive spec, and leading underscore. */ - /* NOTE: A trailing underscore is not returned on this platform, so we don't need to strip it. [vszakats] */ @@ -1161,11 +1167,14 @@ USHORT hb_fsCurDirBuff( USHORT uiDrive, BYTE * pbyBuffer, ULONG ulLen ) memmove( pbyBuffer, pbyStart, ulLen ); } -#else + /* Strip the trailing (back)slash if there's one */ - s_uiErrorLast = FS_ERROR; + { + ULONG ulLen = strlen( pbyBuffer ); -#endif + if( strchr( OS_PATH_DELIMITER_LIST, pbyBuffer[ ulLen - 1 ] ) ) + pbyBuffer[ ulLen - 1 ] = '\0'; + } return s_uiErrorLast; }