From 6ed916795d2ead0e18348213c3362757adfc2335 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 9 Feb 2009 16:45:15 -0500 Subject: [PATCH] BUG: Work around broken GetLongPathName case On Windows the GetLongPathName API function does not work on some filesystems even if the file exists. In this case we should just use the original long path name and not the GetShortPathName result. See issue #8480. --- Source/kwsys/SystemTools.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index a46cc5b8b..a934b90d6 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -3058,6 +3058,11 @@ kwsys_stl::string SystemTools::GetActualCaseForPath(const char* p) { return p; } + // Use original path if conversion back to a long path failed. + if(longPath == shortPath) + { + longPath = p; + } // make sure drive letter is always upper case if(longPath.size() > 1 && longPath[1] == ':') {