From af6d0e7d543cc43be610e100f224871f4c504fd1 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 14 Apr 2011 06:17:56 +0000 Subject: Support paths starting with \\?\, to fix support for backing up VSS snapshots. --- lib/win32/emu.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'lib/win32') diff --git a/lib/win32/emu.cpp b/lib/win32/emu.cpp index 0afb9fa3..64858a27 100644 --- a/lib/win32/emu.cpp +++ b/lib/win32/emu.cpp @@ -451,7 +451,15 @@ std::string ConvertPathToAbsoluteUnicode(const char *pFileName) return tmpStr; } - if (filename.length() > 2 && filename[0] == '\\' && + if (filename.length() > 4 && filename[0] == '\\' && + filename[1] == '\\' && filename[2] == '?' && + filename[3] == '\\') + { + // File is already in absolute utf-8 format, e.g. + // \\?\GLOBALROOT\... + tmpStr = ""; + } + else if (filename.length() > 2 && filename[0] == '\\' && filename[1] == '\\') { tmpStr += "UNC\\"; @@ -461,13 +469,13 @@ std::string ConvertPathToAbsoluteUnicode(const char *pFileName) } else if (filename.length() >= 1 && filename[0] == '\\') { - // root directory of current drive. + // starts with \, i.e. root directory of current drive. tmpStr = wd; tmpStr.resize(2); // drive letter and colon } else if (filename.length() >= 2 && filename[1] != ':') { - // Must be relative. We need to get the + // Must be a relative path. We need to get the // current directory to make it absolute. tmpStr += wd; if (tmpStr[tmpStr.length()-1] != '\\') -- cgit v1.2.3