forked from premiere/premiere-libtorrent
fixed bug in is_complete for windows
This commit is contained in:
parent
1d0e2c0a37
commit
8fa2f26217
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue