diff --git a/libs/ardour/recent_sessions.cc b/libs/ardour/recent_sessions.cc index c2c8d1a19a..054f4c0f44 100644 --- a/libs/ardour/recent_sessions.cc +++ b/libs/ardour/recent_sessions.cc @@ -30,6 +30,7 @@ #include #include "pbd/error.h" +#include "pbd/file_utils.h" #include "ardour/rc_configuration.h" #include "ardour/filesystem_paths.h" @@ -231,12 +232,14 @@ ARDOUR::store_recent_sessions (string name, string path) return -1; } + path = canonical_path (path); + pair newpair; newpair.first = name; newpair.second = path; - rs.erase(remove(rs.begin(), rs.end(), newpair), rs.end()); + rs.erase (remove_if (rs.begin(), rs.end(), [path](pair const& p) { return p.second == path; }), rs.end()); rs.push_front (newpair);