From 28e9c58e3d362b7e04791875b457794670965ee7 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 25 Oct 2009 21:07:14 +0000 Subject: [PATCH] fixed bug in add_files that would fail to recurse if the path ended with a / --- ChangeLog | 2 ++ include/libtorrent/create_torrent.hpp | 14 ++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) 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 {