diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-12-07 18:52:14 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-12-07 18:52:14 +0000 |
commit | ae63588c0291f59ef3c14b331c5ec4d3c2f84f8e (patch) | |
tree | 2045d9ad4167ef0cb6adbac7d8bec5f02d70b43e /libs/ardour/utils.cc | |
parent | 5ef06dd439088226683beff5c6fc1d5af55a014b (diff) |
improved WORKING fix for search path issues
git-svn-id: svn://localhost/ardour2/branches/3.0@10940 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/utils.cc')
-rw-r--r-- | libs/ardour/utils.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libs/ardour/utils.cc b/libs/ardour/utils.cc index afd83b62b5..8588d9ccd6 100644 --- a/libs/ardour/utils.cc +++ b/libs/ardour/utils.cc @@ -349,6 +349,34 @@ path_expand (string path) } } +string +search_path_expand (string path) +{ + if (path.empty()) { + return path; + } + + vector<string> s; + vector<string> n; + + split (path, s, ':'); + + for (vector<string>::iterator i = s.begin(); i != s.end(); ++i) { + n.push_back (path_expand (*i)); + } + + string r; + + for (vector<string>::iterator i = n.begin(); i != n.end(); ++i) { + if (!r.empty()) { + r += ':'; + } + r += *i; + } + + return r; +} + #if __APPLE__ string CFStringRefToStdString(CFStringRef stringRef) |