On Wed, Feb 22, 2006 at 01:43:47PM +0100, [EMAIL PROTECTED] wrote:
> during testing our modified scripts with lftp, we found an issue.
> Trying to get a remote file, that does not exist, creates a local
> null byte file with the name from the get statement.

Thanks for report. The bug was introduced in 3.4.0. Here is a fix.

--
   Alexander.                      | never mind that noise you heard
Index: FileCopy.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/FileCopy.cc,v
retrieving revision 1.120
diff -u -p -r1.120 FileCopy.cc
--- FileCopy.cc 16 Feb 2006 08:03:31 -0000      1.120
+++ FileCopy.cc 13 Mar 2006 10:39:36 -0000
@@ -149,8 +149,11 @@ int FileCopy::Do()
       }
       if(get->Error() && get->Size()==0)
       {
-        put->PutEOF();
-        Roll(put);
+        if(put->GetPos()>0)
+        {
+           put->PutEOF();
+           Roll(put);
+        }
       get_error:
         SetError(get->ErrorText());
         return MOVED;

Reply via email to