diff --git a/libs/pbd/strreplace.cc b/libs/pbd/strreplace.cc index 2ac8c9cb87..2f4767dec8 100644 --- a/libs/pbd/strreplace.cc +++ b/libs/pbd/strreplace.cc @@ -39,8 +39,9 @@ replace_all (std::string& str, std::string poor_mans_glob (std::string path) { - std::string copy = path; - replace_all (copy, "~", Glib::get_home_dir()); - return copy; + if (path.find ('~') == 0) { + path.replace (0, 1, Glib::get_home_dir()); + } + return path; }