From b8e1c81cba2ebc62a704da6aca034b42ea683ef7 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Mon, 29 Dec 2008 19:20:15 +0000 Subject: [PATCH] 2008-12-29 20:23 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/contrib/hbct/disk.c ! fixed dirname() - thanks to Saulius --- harbour/ChangeLog | 4 ++++ harbour/contrib/hbct/disk.c | 14 +++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d16ca3b002..de9802b67f 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,10 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-12-29 20:23 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/contrib/hbct/disk.c + ! fixed dirname() - thanks to Saulius + 2008-12-29 19:20 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbcomp.h * harbour/include/hbmacro.ch diff --git a/harbour/contrib/hbct/disk.c b/harbour/contrib/hbct/disk.c index 006973b551..43992f1acf 100644 --- a/harbour/contrib/hbct/disk.c +++ b/harbour/contrib/hbct/disk.c @@ -101,9 +101,21 @@ HB_FUNC( DIRMAKE ) HB_FUNC( DIRNAME ) { BYTE *pbyBuffer = ( BYTE * ) hb_xgrab( _POSIX_PATH_MAX + 1 ); + unsigned char *pszDrive = ( unsigned char * ) hb_parc( 1 ); + USHORT uiDrive = 0; + if( pszDrive ) + { + /* some network drivers (f.e. NETX from Novel Netware) allow + * to create drives after 'Z' letter. + */ + if( *pszDrive >= 'A' && *pszDrive < 'A' + 32 ) + uiDrive = *pszDrive - ( 'A' - 1 ); + else if( *pszDrive >= 'a' && *pszDrive < 'a' + 32 ) + uiDrive = *pszDrive - ( 'a' - 1 ); + } pbyBuffer[0] = HB_OS_PATH_DELIM_CHR; - hb_fsCurDirBuff( hb_fsCurDrv(), pbyBuffer + 1, _POSIX_PATH_MAX ); + hb_fsCurDirBuff( uiDrive, pbyBuffer + 1, _POSIX_PATH_MAX ); hb_retc_buffer( ( char * ) pbyBuffer ); }