merged changes from RC_1_0

This commit is contained in:
Arvid Norberg 2014-12-17 14:33:52 +00:00
parent 20b4608c38
commit ca3c1620bd
2 changed files with 5 additions and 0 deletions

View File

@ -941,6 +941,7 @@ namespace libtorrent
std::string complete(std::string const& f)
{
if (is_complete(f)) return f;
if (f == ".") return current_working_directory();
return combine_path(current_working_directory(), f);
}

View File

@ -153,6 +153,8 @@ int test_main()
// test path functions
TEST_EQUAL(combine_path("test1/", "test2"), "test1/test2");
TEST_EQUAL(combine_path("test1", "."), "test1");
TEST_EQUAL(combine_path(".", "test1"), "test1");
#ifdef TORRENT_WINDOWS
TEST_EQUAL(combine_path("test1\\", "test2"), "test1\\test2");
TEST_EQUAL(combine_path("test1", "test2"), "test1\\test2");
@ -239,6 +241,8 @@ int test_main()
TEST_EQUAL(is_complete(""), false);
#endif
TEST_EQUAL(complete("."), current_working_directory());
// test split_string
char const* tags[10];