summaryrefslogtreecommitdiff
path: root/libs/ardour/session_state.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-05-28 16:32:41 +0000
committerCarl Hetherington <carl@carlh.net>2012-05-28 16:32:41 +0000
commit7eb8a33910bfdab21b98d794dc731bc8e8557cb9 (patch)
tree8a22b28badb6f4bdfd9c9660c50f6e5c1605e8c9 /libs/ardour/session_state.cc
parentd825f20a324dc05fae612b748c579c22df88a471 (diff)
Add path_is_within to decide if a path is within a given
directory, taking symlinks into account, and use it to decide whether a file is within the session folder. Should fix #4552. git-svn-id: svn://localhost/ardour2/branches/3.0@12468 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r--libs/ardour/session_state.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 4b40a80d80..e729a7b00d 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -428,7 +428,7 @@ bool
Session::path_is_within_session (const std::string& path)
{
for (vector<space_and_path>::const_iterator i = session_dirs.begin(); i != session_dirs.end(); ++i) {
- if (path.find ((*i).path) == 0) {
+ if (PBD::sys::path_is_within (i->path, path)) {
return true;
}
}