On Sun, Jul 09, 2006 at 09:07:38AM +0200, gabriele balducci wrote:
> After upgrading 3.4.7 -> 3.5.1, I've noticed that there is a
> difference in in the output of lftp's ls command.
>
> versions <=3.4.7 used to give:
>
> -rw-r--r--    1 ftp      ftp          3638 Jan 12 22:28 KEY
>
> while 3.5.1 gives me:
>
> -rw-r--r--    1 ftp      ftp          3638 Jan 12 22:28 KEY^M
>
> i.e. a carriage return (^M) is appended at end of lines.

Here is a patch to correct the problem.

--
   Alexander.
Index: commands.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/commands.cc,v
retrieving revision 1.255
diff -u -p -r1.255 commands.cc
--- commands.cc 7 Jul 2006 05:15:31 -0000       1.255
+++ commands.cc 10 Jul 2006 07:55:17 -0000
@@ -1343,6 +1343,7 @@ CMD(ls)
    bool re=false;
    int mode=FA::LIST;
    const char *op=args->a0();
+   bool ascii=true;
    if(strstr(op,"nlist"))
       nlist=true;
    if(!strncmp(op,"re",2))
@@ -1355,6 +1356,7 @@ CMD(ls)
         return 0;
       }
       nlist=true;
+      ascii=false;
       mode=FA::QUOTE_CMD;
       if(!strcmp(op,"site"))
         args->insarg(1,"SITE");
@@ -1392,6 +1394,8 @@ CMD(ls)
    FileCopy *c=FileCopy::New(src_peer,dst_peer,false);
    c->DontCopyDate();
    c->LineBuffered();
+   if(ascii)
+      c->Ascii();
 
    CopyJob *j=new CopyJob(c,a,op);
    if(!output || output->usesfd(1))

Reply via email to