X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Finternet.cc;h=7bc818717a44737f2719960a8bc8832aff4eec82;hp=b45eaabf7580ec2c74a0d0559d3b0ed54b377223;hb=aeb835a18c8df347e0ed68fb24631b320abeb611;hpb=59f63e2b6d0dba963faee7dfee54fbb48dee396a diff --git a/src/lib/internet.cc b/src/lib/internet.cc index b45eaabf7..7bc818717 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) @@ -51,7 +53,7 @@ get_from_zip_url (string url, string file, function (_("Could not open downloaded ZIP file")); } - + struct zip_file* zip_file = zip_fopen (zip, file.c_str(), 0); if (!zip_file) { return optional (_("Unexpected ZIP file contents")); } - + ScopedTemporary temp_cert; f = temp_cert.open ("wb"); char buffer[4096]; @@ -91,7 +93,7 @@ get_from_zip_url (string url, string file, function (); } @@ -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 != "..") {