]> sjero.net Git - wget/commitdiff
[svn] Delete trailing newlines from LIST output when -S is used.
authorhniksic <devnull@localhost>
Tue, 28 Jun 2005 00:13:44 +0000 (17:13 -0700)
committerhniksic <devnull@localhost>
Tue, 28 Jun 2005 00:13:44 +0000 (17:13 -0700)
src/ChangeLog
src/ftp.c

index 690debe661578c5f499f7684d29b890440c831fa..f00261a27384bf3ae1b89d0e9fe149e6f4e94524 100644 (file)
@@ -1,3 +1,8 @@
+2005-06-28  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * ftp.c (getftp): Delete trailing newlines from LIST output so
+       lines don't come out with trailing \015\012 with -S.
+
 2005-06-27  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * mswindows.h: Remove superfluous includes.
index 0d903d35fcf41ce6c0ba920f92a6b957f4bafe90..52755f40b6f74df75f6089901515825829e10b24 100644 (file)
--- a/src/ftp.c
+++ b/src/ftp.c
@@ -1068,6 +1068,9 @@ Error in server response, closing control connection.\n"));
             no-buffering on opt.lfile.  */
          while ((line = read_whole_line (fp)) != NULL)
            {
+             char *p = strchr (line, '\0');
+             while (p > line && (p[-1] == '\n' || p[-1] == '\r'))
+               *--p = '\0';
              logprintf (LOG_ALWAYS, "%s\n", escnonprint (line));
              xfree (line);
            }