From 8433ad7e00448a0d3eead9d44d4f13430c99e905 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 15 Aug 2010 19:04:16 +0000 Subject: [PATCH] 2010-08-15 21:00 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/fslink.c ! Fixed hb_fsLinkRead() on Win Vista/7 for non-links (untested) * contrib/make.hbs * Comment --- harbour/ChangeLog | 7 +++++++ harbour/contrib/make.hbs | 2 +- harbour/src/rtl/fslink.c | 10 ++++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 5ce6ff23b1..a5f6bcdb5f 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,13 @@ The license applies to all entries newer than 2009-04-28. */ +2010-08-15 21:00 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * src/rtl/fslink.c + ! Fixed hb_fsLinkRead() on Win Vista/7 for non-links + + * contrib/make.hbs + * Comment + 2010-08-14 20:23 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * include/harbour.hbx * include/hbapifs.h diff --git a/harbour/contrib/make.hbs b/harbour/contrib/make.hbs index 5be238631f..c9ec4c6a7b 100755 --- a/harbour/contrib/make.hbs +++ b/harbour/contrib/make.hbs @@ -36,7 +36,7 @@ 3. Move lib output dir and workdirs inside contrib dirs. 4. Make home project detection more robust in stdalone mode. - NOTE: + NOTE: - 'install' is ignored in stdalone mode. It would be needed to replicate the install dir defaulting logic found in global.mk to implement it. diff --git a/harbour/src/rtl/fslink.c b/harbour/src/rtl/fslink.c index 2b3f92c32e..0ced137231 100644 --- a/harbour/src/rtl/fslink.c +++ b/harbour/src/rtl/fslink.c @@ -234,8 +234,14 @@ char * hb_fsLinkRead( const char * pszFile ) size = s_pGetFinalPathNameByHandle( lpFileName, lpLink, HB_PATH_MAX, VOLUME_NAME_DOS ); if( size < HB_PATH_MAX ) { - pszLink = ( char * ) hb_xgrab( size ); - hb_wcntombcpy( pszLink, lpLink, ( HB_SIZE ) size ); + if( size > 0 ) + { + pszLink = ( char * ) hb_xgrab( size + 1 ); + hb_wcntombcpy( pszLink, lpLink, ( HB_SIZE ) size ); + } + else + pszLink = NULL; + hb_fsSetIOError( HB_TRUE, 0 ); hb_fsSetFError( hb_fsError() ); }