From 056e778977a40c24571cc7fab9ae192e97856e72 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 21 Feb 2011 17:25:43 +0000 Subject: [PATCH] 2011-02-21 18:25 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/fscopy.c ! Fixed missing header in prev. ! Fixed to check empty value of parameters properly. --- harbour/ChangeLog | 5 +++++ harbour/src/rtl/fscopy.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 66e6b03441..c25b3c97bd 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,11 @@ The license applies to all entries newer than 2009-04-28. */ +2011-02-21 18:25 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * src/rtl/fscopy.c + ! Fixed missing header in prev. + ! Fixed to check empty value of parameters properly. + 2011-02-21 16:40 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/fscopy.c ! HB_FCOPY(): RTE when either of the parameters is not string. diff --git a/harbour/src/rtl/fscopy.c b/harbour/src/rtl/fscopy.c index cd24018e77..f6b28dedaf 100644 --- a/harbour/src/rtl/fscopy.c +++ b/harbour/src/rtl/fscopy.c @@ -51,6 +51,7 @@ */ #include "hbapi.h" +#include "hbapierr.h" #include "hbapifs.h" #if defined( HB_OS_UNIX ) @@ -131,11 +132,11 @@ HB_FUNC( HB_FCOPY ) { const char * pszSource = hb_parc( 1 ), * pszDest = hb_parc( 2 ); - if( pszSource && pszDest ) + if( *pszSource && *pszDest ) hb_retni( hb_fsCopy( pszSource, pszDest ) ? 0 : F_ERROR ); else { - hb_fsSetFError( 2 ); + hb_fsSetFError( 2 /* file not found */ ); hb_retni( F_ERROR ); } }