summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-08-25 13:50:19 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-08-25 13:50:19 (GMT)
commitd8b70f62cb1a5ea7231c4236bed57206068a946c (patch)
tree65e113552066c1210db721aa81c8fdaa20507e85 /Source
parentd6734eeb875ceca5d810e829ca90541918dca2b4 (diff)
parent7bc6dccc0a993ddb3681100e28405189be09ff72 (diff)
downloadCMake-d8b70f62cb1a5ea7231c4236bed57206068a946c.zip
CMake-d8b70f62cb1a5ea7231c4236bed57206068a946c.tar.gz
CMake-d8b70f62cb1a5ea7231c4236bed57206068a946c.tar.bz2
Merge topic 'update-kwsys'
7bc6dccc Merge branch 'upstream-KWSys' into update-kwsys fcc53247 KWSys 2016-08-24 (8e643b9b)
Diffstat (limited to 'Source')
-rw-r--r--Source/kwsys/SystemTools.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index eb2bec6..1a73b16 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -4725,8 +4725,11 @@ bool SystemTools::GetShortPath(const std::string& path, std::string& shortPath)
std::wstring wtempPath = Encoding::ToWide(tempPath);
DWORD ret = GetShortPathNameW(wtempPath.c_str(), NULL, 0);
std::vector<wchar_t> buffer(ret);
- ret = GetShortPathNameW(wtempPath.c_str(),
- &buffer[0], static_cast<DWORD>(buffer.size()));
+ if (ret != 0)
+ {
+ ret = GetShortPathNameW(wtempPath.c_str(),
+ &buffer[0], static_cast<DWORD>(buffer.size()));
+ }
if (ret == 0)
{