diff options
Diffstat (limited to 'lib/System/Unix/Path.inc')
-rw-r--r-- | lib/System/Unix/Path.inc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc index c3d06a3fa1..fe2e3c6777 100644 --- a/lib/System/Unix/Path.inc +++ b/lib/System/Unix/Path.inc @@ -277,16 +277,18 @@ Path Path::GetMainExecutable(const char *argv0, void *MainAddr) { } +std::string Path::getDirname() const { return getDirnameCharSep('/'); } + std::string Path::getBasename() const { // Find the last slash - size_t slash = path.rfind('/'); + std::string::size_type slash = path.rfind('/'); if (slash == std::string::npos) slash = 0; else slash++; - size_t dot = path.rfind('.'); + std::string::size_type dot = path.rfind('.'); if (dot == std::string::npos || dot < slash) return path.substr(slash); else |