From 4fb5d4596bd51fcd33d97b3888d46fe018803e21 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 5 Mar 2012 00:34:45 +0000 Subject: [PATCH] Prevent duplication of search path elements when symlinks are involved (#4568). git-svn-id: svn://localhost/ardour2/branches/3.0@11592 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/session.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 10039a7ff4..bafa50a275 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -4482,7 +4482,13 @@ Session::ensure_search_path_includes (const string& path, DataType type) split (search_path, dirs, ':'); for (vector::iterator i = dirs.begin(); i != dirs.end(); ++i) { - if (*i == path) { + /* No need to add this new directory if it has the same inode as + an existing one; checking inode rather than name prevents duplicated + directories when we are using symlinks. + + On Windows, I think we could just do if (*i == path) here. + */ + if (inodes_same (*i, path)) { return; } }