diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-08-17 13:10:42 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-08-17 13:10:42 +0000 |
commit | a5e74a774c6e1b39672392e26ee48385c4ac0034 (patch) | |
tree | adabcf01a62a93c8d09f81daf91935b1e0a3c5cb /libs/ardour/find_session.cc | |
parent | 6ad57df62b5edaaa09fcc604358861ce82e64342 (diff) |
forward port 2.X changes up to and including rev 6909
git-svn-id: svn://localhost/ardour2/branches/3.0@7639 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/find_session.cc')
-rw-r--r-- | libs/ardour/find_session.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/libs/ardour/find_session.cc b/libs/ardour/find_session.cc index 90a54b1390..c635b86545 100644 --- a/libs/ardour/find_session.cc +++ b/libs/ardour/find_session.cc @@ -5,6 +5,8 @@ #include <climits> #include <cerrno> +#include <glibmm/miscutils.h> + #include "pbd/compose.h" #include "pbd/error.h" @@ -53,17 +55,13 @@ ARDOUR::find_session (string str, string& path, string& snapshot, bool& isnew) if (S_ISDIR (statbuf.st_mode)) { - string::size_type slash = str.find_last_of ('/'); + string::size_type slash = str.find_last_of (G_DIR_SEPARATOR); if (slash == string::npos) { /* a subdirectory of cwd, so statefile should be ... */ - string tmp; - tmp = str; - tmp += '/'; - tmp += str; - tmp += statefile_suffix; + string tmp = Glib::build_filename (str, str+statefile_suffix); /* is it there ? */ @@ -90,7 +88,7 @@ ARDOUR::find_session (string str, string& path, string& snapshot, bool& isnew) } else if (S_ISREG (statbuf.st_mode)) { - string::size_type slash = str.find_last_of ('/'); + string::size_type slash = str.find_last_of (G_DIR_SEPARATOR); string::size_type suffix; /* remove the suffix */ @@ -148,7 +146,7 @@ ARDOUR::find_session (string str, string& path, string& snapshot, bool& isnew) as "dirname" does. */ - string::size_type slash = str.find_last_of ('/'); + string::size_type slash = str.find_last_of (G_DIR_SEPARATOR); if (slash == string::npos) { |