#include <climits>
#include <cerrno>
+#include <glibmm/miscutils.h>
+
#include "pbd/compose.h"
#include "pbd/error.h"
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 ? */
} 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 */
suffix = snapshot.find (statefile_suffix);
if (suffix == string::npos) {
- error << string_compose (_("%1 is not an Ardour snapshot file"), str) << endmsg;
+ error << string_compose (_("%1 is not a snapshot file"), str) << endmsg;
return -1;
}
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) {