From 2689848ed796dfc070da96c215e31add06577226 Mon Sep 17 00:00:00 2001 From: John Emmas Date: Tue, 3 Feb 2015 11:57:38 +0000 Subject: [PATCH] Add an extra test to prevent 'PBD::path_is_within()' from looping infinitely on Windows The infinite loop would happen if the 2 supplied paths were on different Windows drives - for example if one was on drive C:\ and the other on drive E:\ I don't think this new test will be detrimental to the other platforms but if it is, we could easily separate it out with a '#ifdef PLATFORM_WINDOWS' directive. --- libs/pbd/file_utils.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/pbd/file_utils.cc b/libs/pbd/file_utils.cc index f8ab326c5b..9523fdd6bd 100644 --- a/libs/pbd/file_utils.cc +++ b/libs/pbd/file_utils.cc @@ -379,7 +379,7 @@ path_is_within (std::string const & haystack, std::string needle) } needle = Glib::path_get_dirname (needle); - if (needle == "." || needle == "/") { + if (needle == "." || needle == "/" || Glib::path_skip_root(needle).empty()) { break; } } -- 2.30.2