strip trailing dots and spaces in filenames
This commit is contained in:
@@ -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)
|
||||
|
1
test/test_torrents/invalid_name3.torrent
Normal file
1
test/test_torrents/invalid_name3.torrent
Normal 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
|
Reference in New Issue
Block a user