strip trailing dots and spaces in filenames

This commit is contained in:
Arvid Norberg
2013-12-05 07:40:57 +00:00
parent 9c761f6777
commit 88e4e0a97b
3 changed files with 45 additions and 25 deletions

View File

@@ -72,6 +72,7 @@ test_torrent_t test_torrents[] =
{ "url_seed_multi_space_nolist.torrent" },
{ "root_hash.torrent" },
{ "empty_path_multi.torrent" },
{ "invalid_name3.torrent" },
};
struct test_failing_torrent_t
@@ -423,6 +424,10 @@ int test_main()
TEST_EQUAL(ti->url_seeds()[0], "http://test.com/test%20file/foo%20bar/");
#endif
}
else if (std::string(test_torrents[i].file) == "invalid_name3.torrent")
{
TEST_EQUAL(ti->name(), "foobar");
}
file_storage const& fs = ti->files();
for (int i = 0; i < fs.num_files(); ++i)

View File

@@ -0,0 +1 @@
d10:created by10:libtorrent13:creation datei1359599503e4:infod5:filesld6:lengthi425e4:pathl3:foo7:bar.txteed6:lengthi425e4:pathl3:foo7:var.txteee4:name7:foobar 12:piece lengthi16384e6:pieces20:<3A><><EFBFBD><EFBFBD>&<26><>JW<4A>}<7D>A4u,<2C><><EFBFBD><EFBFBD>ee