diff options
author | Brad King <brad.king@kitware.com> | 2016-08-24 14:55:19 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-08-24 14:55:19 (GMT) |
commit | 7bc6dccc0a993ddb3681100e28405189be09ff72 (patch) | |
tree | 7823e635940334345f1d37ef1c8797d27db207d2 /Source/kwsys/SystemTools.cxx | |
parent | 96de37092a29cb2e7a92e9cb10b0ef47bca32732 (diff) | |
parent | fcc532470aa56e7a2e345f7f2396774787feb2ce (diff) | |
download | CMake-7bc6dccc0a993ddb3681100e28405189be09ff72.zip CMake-7bc6dccc0a993ddb3681100e28405189be09ff72.tar.gz CMake-7bc6dccc0a993ddb3681100e28405189be09ff72.tar.bz2 |
Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
KWSys 2016-08-24 (8e643b9b)
Diffstat (limited to 'Source/kwsys/SystemTools.cxx')
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 7 |
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) { |