summaryrefslogtreecommitdiff
path: root/src/lib/internet.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-01-12 11:54:33 +0000
committerCarl Hetherington <cth@carlh.net>2015-01-12 11:54:33 +0000
commitf50ef83dc201047ff27a6ebd9b56104ce120dd9a (patch)
treeaf6ba9b4df47748d09a0988e39cdebdd82b0f8cf /src/lib/internet.cc
parentd76379433b9ac795fd0286f4c8fca68d68561183 (diff)
Forward-port FTP fix from 1.x.
Diffstat (limited to 'src/lib/internet.cc')
-rw-r--r--src/lib/internet.cc7
1 files 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 <cth@carlh.net>
+ Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
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 <boost/function.hpp>
#include <boost/optional.hpp>
#include <boost/filesystem.hpp>
+#include <boost/algorithm/string.hpp>
#include <curl/curl.h>
#include <zip.h>
#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<string> 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 != "..") {