path fixes on windows
parent
3d8dbcbab2
commit
c990134bb7
|
@ -133,7 +133,7 @@ struct path {
|
||||||
if (!endp) {
|
if (!endp) {
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
char const *pendp = strchr(endp, '\\');
|
char const *pendp = strchr(endp + 1, '\\');
|
||||||
if (!pendp) {
|
if (!pendp) {
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
@ -188,7 +188,7 @@ struct path {
|
||||||
if (sep.empty()) {
|
if (sep.empty()) {
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
return ostd::string_range{p_path.data(), sep.data()};
|
return path{ostd::string_range{p_path.data(), sep.data()}, p_fmt};
|
||||||
}
|
}
|
||||||
|
|
||||||
bool has_parent() const noexcept {
|
bool has_parent() const noexcept {
|
||||||
|
@ -250,9 +250,9 @@ struct path {
|
||||||
|
|
||||||
path relative_to(path const &other) const {
|
path relative_to(path const &other) const {
|
||||||
if (path_fmt(other.p_fmt) != path_fmt(p_fmt)) {
|
if (path_fmt(other.p_fmt) != path_fmt(p_fmt)) {
|
||||||
return relative_to_str(path{other, p_fmt}.p_path);
|
return path{relative_to_str(path{other, p_fmt}.p_path), p_fmt};
|
||||||
} else {
|
} else {
|
||||||
return relative_to_str(other.p_path);
|
return path{relative_to_str(other.p_path), p_fmt};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue