From a783c4648f506a307b865c41a97d2c49fb0a3062 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 11 Mar 2010 23:40:40 +0000 Subject: [PATCH] 2010-03-12 00:39 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/filesys.c ! Fixed fs_win_get_drive() to return zero (instead of -1) when drive letter wasn't returned by Windows API. (it's not clear what is the proper error behavior here) ! Fixed fs_win_set_drive() to apply upper limit on input parameter. * contrib/rddsql/sddfb/sddfb.c * Minor formatting. --- harbour/ChangeLog | 11 +++++++++++ harbour/contrib/rddsql/sddfb/sddfb.c | 3 ++- harbour/src/rtl/filesys.c | 8 +++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 08fd73a2c7..8263c243ce 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,17 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-03-12 00:39 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * src/rtl/filesys.c + ! Fixed fs_win_get_drive() to return zero (instead of -1) + when drive letter wasn't returned by Windows API. + (it's not clear what is the proper error behavior here) + ! Fixed fs_win_set_drive() to apply upper limit on input + parameter. + + * contrib/rddsql/sddfb/sddfb.c + * Minor formatting. + 2010-03-11 23:27 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/rddsql/sddfb/sddfb.c ! Few cleanups in the FB RDDSQL interface (macro and type usage). diff --git a/harbour/contrib/rddsql/sddfb/sddfb.c b/harbour/contrib/rddsql/sddfb/sddfb.c index 1202abe1d4..8acc1fbcaf 100644 --- a/harbour/contrib/rddsql/sddfb/sddfb.c +++ b/harbour/contrib/rddsql/sddfb/sddfb.c @@ -229,7 +229,8 @@ static HB_ERRCODE fbOpen( SQLBASEAREAP pArea ) return HB_FAILURE; } - if ( pSqlda->sqld > pSqlda->sqln ) { + if ( pSqlda->sqld > pSqlda->sqln ) + { uiFields = pSqlda->sqld; hb_xfree( pSqlda ); pSqlda = ( XSQLDA * ) hb_xgrab( XSQLDA_LENGTH( uiFields ) ); diff --git a/harbour/src/rtl/filesys.c b/harbour/src/rtl/filesys.c index 14107493ed..c4c9a4ab9c 100644 --- a/harbour/src/rtl/filesys.c +++ b/harbour/src/rtl/filesys.c @@ -54,13 +54,15 @@ * The following parts are Copyright of the individual authors. * www - http://www.harbour-project.org * - * Copyright 1999-2001 Viktor Szakats (harbour.01 syenar.hu) + * Copyright 1999-2010 Viktor Szakats (harbour.01 syenar.hu) * hb_fsSetError() * hb_fsSetDevMode() * hb_fsReadLarge() * hb_fsWriteLarge() * hb_fsCurDirBuff() * hb_fsBaseDirBuff() + * fs_win_get_drive() + * fs_win_set_drive() * * Copyright 1999 Jose Lalin * hb_fsChDrv() @@ -334,7 +336,7 @@ static int fs_win_get_drive( void ) if( pFilepath->szDrive ) iDrive = HB_TOUPPER( pFilepath->szDrive[ 0 ] ) - 'A'; else - iDrive = -1; + iDrive = 0; hb_xfree( pFilepath ); @@ -343,7 +345,7 @@ static int fs_win_get_drive( void ) static void fs_win_set_drive( int iDrive ) { - if( iDrive >= 0 ) + if( iDrive >= 0 && iDrive <= 25 ) { TCHAR szBuffer[ 3 ];