diff options
Diffstat (limited to 'libs/pbd3/basename.cc')
-rw-r--r-- | libs/pbd3/basename.cc | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/libs/pbd3/basename.cc b/libs/pbd3/basename.cc index b8c5c64d91..a51e393b78 100644 --- a/libs/pbd3/basename.cc +++ b/libs/pbd3/basename.cc @@ -2,37 +2,10 @@ #include <string.h> #include <pbd/basename.h> -char * -PBD::basename (const char *path) - -{ - char *slash; - - if ((slash = strrchr (path, '/')) == 0) { - return strdup (path); - } - - if (*(slash+1) == '\0') { - return strdup (""); - } - - return strdup (slash+1); -} - -std::string -PBD::basename (const std::string str) -{ - std::string::size_type slash = str.find_last_of ('/'); - - if (slash == std::string::npos) { - return str; - } - - return str.substr (slash+1); -} +// implement this using Glib::path_get_basename std::string -PBD::basename_nosuffix (const std::string str) +PBD::basename_nosuffix (const std::string& str) { std::string::size_type slash = str.find_last_of ('/'); std::string noslash; |