X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Finternet.cc;h=b4395fd212c732b3d66da2cb00f07bad34e77dd2;hb=ef4b082c5d7452a34ce45f6d3bead46a7e846faf;hp=16fd67244f4d0753ffe5e12f115ab4afa41a9cc1;hpb=4438476ea07f171ef4909f0882b490dfcfb7094c;p=dcpomatic.git diff --git a/src/lib/internet.cc b/src/lib/internet.cc index 16fd67244..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,17 +21,20 @@ #include #include #include +#include #include #include -#include "util.h" +#include "scoped_temporary.h" +#include "compose.hpp" +#include "safe_stringstream.h" #include "i18n.h" using std::string; -using std::stringstream; 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) @@ -55,6 +58,9 @@ get_from_zip_url (string url, string file, function (); } - stringstream s (ls_raw); - string line; + SafeStringStream s (ls_raw); list ls; while (s.good ()) { - getline (s, line); + string line = s.getline (); + trim (line); if (line.length() > 55) { string const file = line.substr (55); if (file != "." && file != "..") {