From: hniksic Date: Tue, 28 Jun 2005 00:13:44 +0000 (-0700) Subject: [svn] Delete trailing newlines from LIST output when -S is used. X-Git-Tag: v1.13~865 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=4aea3747e3360ae8ffe1fbcbd1ca9ee4fb06d4e2 [svn] Delete trailing newlines from LIST output when -S is used. --- diff --git a/src/ChangeLog b/src/ChangeLog index 690debe6..f00261a2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-06-28 Hrvoje Niksic + + * 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 * mswindows.h: Remove superfluous includes. diff --git a/src/ftp.c b/src/ftp.c index 0d903d35..52755f40 100644 --- 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); }