diff --git a/ChangeLog b/ChangeLog index 02a260c97..836df4b7d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -90,6 +90,8 @@ release 0.14.7 * fixed incorrect error when deleting files from a torrent where not all files have been created * announces torrents immediately to the DHT when it's started + * fixed bug in add_files that would fail to recurse if the path + ended with a / release 0.14.6 diff --git a/include/libtorrent/create_torrent.hpp b/include/libtorrent/create_torrent.hpp index 918563f0f..3b6640fc2 100644 --- a/include/libtorrent/create_torrent.hpp +++ b/include/libtorrent/create_torrent.hpp @@ -181,22 +181,20 @@ namespace libtorrent { using boost::filesystem::basic_path; using boost::filesystem::basic_directory_iterator; -#if BOOST_VERSION < 103600 - Str const& leaf = l.leaf(); -#else - Str const& leaf = l.filename(); -#endif - if (ignore_subdir(leaf)) return; if (!pred(l)) return; basic_path f(p / l); if (is_directory(f)) { for (basic_directory_iterator > i(f), end; i != end; ++i) + { #if BOOST_VERSION < 103600 - add_files_impl(fs, p, l / i->path().leaf(), pred); + Str const& leaf = i->path().leaf(); #else - add_files_impl(fs, p, l / i->path().filename(), pred); + Str const& leaf = i->path().filename(); #endif + if (ignore_subdir(leaf)) continue; + add_files_impl(fs, p, l / leaf, pred); + } } else {