Besides the upstream author didn't yet answer my email, it's probably better 
anyway I submit my patch for this bug, and the author, as well as anyone else 
interested, may comment on it afterwards.

==============================================================================
diff -uNpr lftp-4.3.6/src/CmdExec.cc lftp-4.3.7/src/CmdExec.cc
--- lftp-4.3.6/src/CmdExec.cc    2012-01-24 10:38:25.000000000 +0100
+++ lftp-4.3.7/src/CmdExec.cc    2012-05-30 08:18:54.000000000 +0200
@@ -351,7 +351,7 @@ void CmdExec::AtFinish()
 {
    if(queue_feeder && queue_feeder->JobCount())
       return;
-   if(!fed_at_finish && NumAwaitedJobs()==0) {
+   if(!fed_at_finish && NumAwaitedJobs()==0 && cmd_buf.Size()==0) {
       
FeedCmd(ResMgr::Query(queue_feeder?"cmd:at-queue-finish":"cmd:at-finish",0));
       FeedCmd("\n");
       fed_at_finish=true;
diff -uNpr lftp-4.3.6/src/FileFeeder.cc lftp-4.3.7/src/FileFeeder.cc
--- lftp-4.3.6/src/FileFeeder.cc    2012-01-24 10:38:25.000000000 +0100
+++ lftp-4.3.7/src/FileFeeder.cc    2012-05-30 07:49:12.000000000 +0200
@@ -36,7 +36,7 @@ const char *FileFeeder::NextCmd(CmdExec
    }
    if(fg_data==0)
       fg_data=new FgData(in->GetProcGroup(),true);
-   int res=read(fd,buffer,buffer_size-1);
+   int res=read(fd,buffer,sizeof(buffer)-1);
    if(res==0)
    {
       return 0;
diff -uNpr lftp-4.3.6/src/FileFeeder.h lftp-4.3.7/src/FileFeeder.h
--- lftp-4.3.6/src/FileFeeder.h    2012-01-24 10:38:26.000000000 +0100
+++ lftp-4.3.7/src/FileFeeder.h    2012-05-30 07:48:46.000000000 +0200
@@ -25,9 +25,8 @@
 class FileFeeder : public CmdFeeder
 {
    Ref<FDStream> in;
-   enum { buffer_size=0x1000 };
-   char buffer[buffer_size];
    Ref<FgData> fg_data;
+   char buffer[0x1001];
 public:
    const char *NextCmd(CmdExec *exec,const char *prompt);
    FileFeeder(FDStream *in);
==============================================================================

-- 
Marko Ranđelović, B.Sc.
Software Developer
Niš, Serbia
[email protected]


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to