summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-08-25 09:50:19 -0400
committerCMake Topic Stage <kwrobot@kitware.com>2016-08-25 09:50:19 -0400
commitd8b70f62cb1a5ea7231c4236bed57206068a946c (patch)
tree65e113552066c1210db721aa81c8fdaa20507e85
parentd6734eeb875ceca5d810e829ca90541918dca2b4 (diff)
parent7bc6dccc0a993ddb3681100e28405189be09ff72 (diff)
downloadcmake-d8b70f62cb1a5ea7231c4236bed57206068a946c.tar.gz
Merge topic 'update-kwsys'
7bc6dccc Merge branch 'upstream-KWSys' into update-kwsys fcc53247 KWSys 2016-08-24 (8e643b9b)
-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 eb2bec65fc..1a73b164b4 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)
{