mirror of
https://git.mirrors.martin98.com/https://github.com/gulrak/filesystem
synced 2025-06-04 11:13:58 +08:00
Merge branch 'master' of github.com:gulrak/filesystem
This commit is contained in:
commit
683ed6838e
@ -2683,7 +2683,7 @@ GHC_INLINE path path::lexically_relative(const path& base) const
|
|||||||
}
|
}
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (const auto& element : input_iterator_range<const_iterator>(b, base.end())) {
|
for (const auto& element : input_iterator_range<const_iterator>(b, base.end())) {
|
||||||
if (element != "." && element != "..") {
|
if (element != "." && element != "" && element != "..") {
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
else if (element == "..") {
|
else if (element == "..") {
|
||||||
|
@ -882,6 +882,7 @@ TEST_CASE("30.10.8.4.11 path generation", "[filesystem][path][fs.path.gen]")
|
|||||||
CHECK(fs::path("a/b/c").lexically_relative("a/b/c/x/y") == "../..");
|
CHECK(fs::path("a/b/c").lexically_relative("a/b/c/x/y") == "../..");
|
||||||
CHECK(fs::path("a/b/c").lexically_relative("a/b/c") == ".");
|
CHECK(fs::path("a/b/c").lexically_relative("a/b/c") == ".");
|
||||||
CHECK(fs::path("a/b").lexically_relative("c/d") == "../../a/b");
|
CHECK(fs::path("a/b").lexically_relative("c/d") == "../../a/b");
|
||||||
|
CHECK(fs::path("a/b").lexically_relative("a/") == "b");
|
||||||
if (has_host_root_name_support()) {
|
if (has_host_root_name_support()) {
|
||||||
CHECK(fs::path("//host1/foo").lexically_relative("//host2.bar") == "");
|
CHECK(fs::path("//host1/foo").lexically_relative("//host2.bar") == "");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user