summaryrefslogtreecommitdiff
path: root/libs/pbd/search_path.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/pbd/search_path.cc')
-rw-r--r--libs/pbd/search_path.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/libs/pbd/search_path.cc b/libs/pbd/search_path.cc
index c441c01211..895bc59909 100644
--- a/libs/pbd/search_path.cc
+++ b/libs/pbd/search_path.cc
@@ -52,9 +52,15 @@ Searchpath::Searchpath (const vector<std::string>& paths)
void
Searchpath::add_directory (const std::string& directory_path)
{
- if (!directory_path.empty()) {
- push_back(directory_path);
+ if (directory_path.empty()) {
+ return;
}
+ for (vector<std::string>::const_iterator i = begin(); i != end(); ++i) {
+ if (*i == directory_path) {
+ return;
+ }
+ }
+ push_back(directory_path);
}
void