merge fix from RC_0_16

This commit is contained in:
Arvid Norberg 2013-03-25 22:35:52 +00:00
parent 8bc8c1abe8
commit d0c2453f9e
2 changed files with 7 additions and 0 deletions

View File

@ -19,6 +19,7 @@
* fix uTP edge case where udp socket buffer fills up
* fix nagle implementation in uTP
* improve handling of filenames that are invalid on windows
* support 'implied_port' in DHT announce_peer
* don't use pool allocator for disk blocks (cache may now return pages to the kernel)

View File

@ -214,6 +214,12 @@ namespace libtorrent
path_element.resize(max_path_len - ext.size());
path_element += ext;
}
// remove trailing spaces and dots. These aren't allowed in filenames on windows
for (int i = path_element.size() - 1; i >= 0; --i)
{
if (path_element[i] != L' ' && path_element[i] != L'.') break;
path_element[i] = L'_';
}
wchar_utf8(path_element, element);
#else
std::string& path_element = element;