Move everything to negative errno return types (#1499)
Some checks failed
CodeQL / Analyze (push) Has been cancelled
mkdocs / deploy (push) Has been cancelled

This commit is contained in:
trapexit 2025-07-25 17:53:48 -05:00 • committed by GitHub
parent 2b500f194a
commit e8cd74cab0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
177 changed files with 5952 additions and 5843 deletions

View file

@ -26,40 +26,34 @@
using std::string;
namespace fs
string
fs::path::dirname(const char *path_)
{
namespace path
{
string
dirname(const char *path_)
{
string path(path_);
string path(path_);
return fs::path::dirname(path);
}
string
dirname(const string &path_)
{
std::size_t i;
i = path_.size() - 1;
while((i > 0) && (path_[i] == '/'))
i--;
while((i > 0) && (path_[i] != '/'))
i--;
while((i > 0) && (path_[i] == '/'))
i--;
return path_.substr(0,i+1);
}
string
basename(const string &path_)
{
return path_.substr(path_.find_last_of('/')+1);
}
}
return fs::path::dirname(path);
}
string
fs::path::dirname(const string &path_)
{
std::size_t i;
i = path_.size() - 1;
while((i > 0) && (path_[i] == '/'))
i--;
while((i > 0) && (path_[i] != '/'))
i--;
while((i > 0) && (path_[i] == '/'))
i--;
return path_.substr(0,i+1);
}
string
fs::path::basename(const string &path_)
{
return path_.substr(path_.find_last_of('/')+1);
}