From e1cbceca253ebf16f49e5bc78e3f1d0157c37bee Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 13 Nov 2021 23:42:46 +0100 Subject: [PATCH] Fix failure to load DCPs from SMB shares (#2123). --- src/lib/cross_windows.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/cross_windows.cc b/src/lib/cross_windows.cc index b3d9a1558..a425186f1 100644 --- a/src/lib/cross_windows.cc +++ b/src/lib/cross_windows.cc @@ -255,14 +255,17 @@ fix_long_path (boost::filesystem::path long_path) { using namespace boost::filesystem; - path fixed = "\\\\?\\"; - if (boost::algorithm::starts_with(long_path.string(), fixed.string())) { + if (boost::algorithm::starts_with(long_path.string(), "\\\\")) { + /* This could mean it starts with \\ (i.e. a SMB path) or \\?\ (a long path) + * or a variety of other things... anyway, we'll leave it alone. + */ return long_path; } /* We have to make the path canonical but we can't call canonical() on the long path * as it will fail. So we'll sort of do it ourselves (possibly badly). */ + path fixed = "\\\\?\\"; if (long_path.is_absolute()) { fixed += long_path.make_preferred(); } else { -- 2.30.2