mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
fix io::path.parent() & update tests
This commit is contained in:
parent
a653b063e6
commit
e4c33e539e
3 changed files with 12 additions and 8 deletions
|
|
@ -110,13 +110,9 @@ namespace io {
|
|||
path parent() const {
|
||||
size_t slashpos = str.rfind('/');
|
||||
if (slashpos == std::string::npos) {
|
||||
return colonPos == std::string::npos
|
||||
? path()
|
||||
: path(str.substr(0, colonPos));
|
||||
return colonPos == std::string::npos ? "" : str;
|
||||
}
|
||||
return colonPos == std::string::npos
|
||||
? path(str.substr(0, slashpos))
|
||||
: path(str.substr(0, colonPos) + str.substr(slashpos));
|
||||
return str.substr(0, slashpos);
|
||||
}
|
||||
|
||||
std::string string() const {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue