summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-11-13 23:42:46 +0100
committerCarl Hetherington <cth@carlh.net>2021-11-13 23:52:48 +0100
commitf0d7300770806592e7fe7a494e66a96ab48463cf (patch)
tree4d9ece1ba9b9c68aa82d7e4f95644db351c50533 /src/lib
parentcb6b19fdbf3e8822916a2925906e9caaff43bc8c (diff)
Fix failure to load DCPs from SMB shares (#2123).
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/cross_windows.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/cross_windows.cc b/src/lib/cross_windows.cc
index 23adc23b1..49eec3c28 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 {