From 4aea3747e3360ae8ffe1fbcbd1ca9ee4fb06d4e2 Mon Sep 17 00:00:00 2001 From: hniksic Date: Mon, 27 Jun 2005 17:13:44 -0700 Subject: [PATCH] [svn] Delete trailing newlines from LIST output when -S is used. --- src/ChangeLog | 5 +++++ src/ftp.c | 3 +++ 2 files changed, 8 insertions(+) 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); } -- 2.39.2