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/file_source.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/file_source.cc')
-rw-r--r-- | libs/ardour/file_source.cc | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/libs/ardour/file_source.cc b/libs/ardour/file_source.cc index 512d37a10b..6a72359a96 100644 --- a/libs/ardour/file_source.cc +++ b/libs/ardour/file_source.cc @@ -215,7 +215,7 @@ FileSource::find (DataType type, const ustring& path, bool must_exist, isnew = false; - if (pathstr[0] != '/') { + if (!Glib::path_is_absolute (pathstr)) { /* non-absolute pathname: find pathstr in search path */ @@ -234,12 +234,8 @@ FileSource::find (DataType type, const ustring& path, bool must_exist, cnt = 0; for (vector<ustring>::iterator i = dirs.begin(); i != dirs.end(); ++i) { - fullpath = *i; - if (fullpath[fullpath.length()-1] != '/') { - fullpath += '/'; - } - - fullpath += pathstr; + + fullpath = Glib::build_filename (*i, pathstr); /* i (paul) made a nasty design error by using ':' as a special character in Ardour 0.99 .. this hack tries to make things sort of work. @@ -263,13 +259,7 @@ FileSource::find (DataType type, const ustring& path, bool must_exist, */ ustring shorter = pathstr.substr (0, pos); - fullpath = *i; - - if (fullpath[fullpath.length()-1] != '/') { - fullpath += '/'; - } - - fullpath += shorter; + fullpath = Glib::build_filename (*i, shorter); if (Glib::file_test (pathstr, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_REGULAR)) { chan = atoi (pathstr.substr (pos+1)); |