From f50ef83dc201047ff27a6ebd9b56104ce120dd9a Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 12 Jan 2015 11:54:33 +0000 Subject: [PATCH 1/1] Forward-port FTP fix from 1.x. --- src/lib/internet.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/internet.cc b/src/lib/internet.cc index b45eaabf7..b4395fd21 100644 --- a/src/lib/internet.cc +++ b/src/lib/internet.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Carl Hetherington + Copyright (C) 2014-2015 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include "scoped_temporary.h" @@ -33,6 +34,7 @@ using std::string; using std::list; using boost::optional; using boost::function; +using boost::algorithm::trim; static size_t get_from_zip_url_data (void* buffer, size_t size, size_t nmemb, void* stream) @@ -138,7 +140,8 @@ ftp_ls (string url) SafeStringStream s (ls_raw); list ls; while (s.good ()) { - string const line = s.getline (); + string line = s.getline (); + trim (line); if (line.length() > 55) { string const file = line.substr (55); if (file != "." && file != "..") { -- 2.30.2