fixed bug in is_complete for windows
This commit is contained in:
@@ -575,7 +575,7 @@ namespace libtorrent
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
// match the xx:\ or xx:/ form
|
// match the xx:\ or xx:/ form
|
||||||
while (f[i] && is_alpha(f[i])) ++i;
|
while (f[i] && is_alpha(f[i])) ++i;
|
||||||
if (i < int(f.size()-2) && f[i] == ':' && (f[i+1] == '\\' || f[i+1] == '/'))
|
if (i < int(f.size()-1) && f[i] == ':' && (f[i+1] == '\\' || f[i+1] == '/'))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// match the \\ form
|
// match the \\ form
|
||||||
|
@@ -543,6 +543,7 @@ int test_main()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef TORRENT_WINDOWS
|
#ifdef TORRENT_WINDOWS
|
||||||
|
TEST_EQUAL(is_complete("c:\\"), true);
|
||||||
TEST_EQUAL(is_complete("c:\\foo\\bar"), true);
|
TEST_EQUAL(is_complete("c:\\foo\\bar"), true);
|
||||||
TEST_EQUAL(is_complete("\\\\foo\\bar"), true);
|
TEST_EQUAL(is_complete("\\\\foo\\bar"), true);
|
||||||
TEST_EQUAL(is_complete("foo/bar"), false);
|
TEST_EQUAL(is_complete("foo/bar"), false);
|
||||||
|
Reference in New Issue
Block a user