From 99cd1b8eb97d66ddccd6480d6daddcc9614dc1b4 Mon Sep 17 00:00:00 2001 From: Manuel Ruiz Date: Wed, 5 May 1999 13:32:40 +0000 Subject: [PATCH] FWRITE: the third parameter is optional and if it is not given we used the length of the string. FSEEK: the third parameter is optional and if it is not given we used FS_SET instead --- harbour/source/rtl/files.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/harbour/source/rtl/files.c b/harbour/source/rtl/files.c index 6f36b94b58..3f1f001f4f 100644 --- a/harbour/source/rtl/files.c +++ b/harbour/source/rtl/files.c @@ -374,9 +374,10 @@ HARBOUR FWRITE() long bytes=0; - if( arg1_it && arg2_it && arg3_it ) + if( arg1_it && arg2_it ) { - bytes = _fsWrite(_parni(1),_parc(2),_parnl(3)); + bytes = (arg3_it ? _parnl(3) : arg2_it->wLength ); + bytes = _fsWrite(_parni(1),_parc(2),bytes); last_error = errno; } @@ -445,10 +446,12 @@ HARBOUR FSEEK() PITEM arg3_it = _param(3,IT_NUMBER); long bytes=0; - - if( arg1_it && arg2_it && arg3_it ) + int pos; + + if( arg1_it && arg2_it ) { - bytes = _fsSeek(_parni(1),_parnl(2),_parni(3)); + pos = (arg3_it ? _parni(3) : FS_SET); + bytes = _fsSeek(_parni(1),_parnl(2),pos); last_error = errno; }