summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/SystemTools.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2005-04-07 20:58:02 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2005-04-07 20:58:02 (GMT)
commitbe32b258cb621d3845f4d33931adca8826f1c5b3 (patch)
treedf4e50556e8101b1de88e1eb2936fac2a2026616 /Source/kwsys/SystemTools.cxx
parentf50e904fafb84dc6ce21698cfd53bb330c0aeb20 (diff)
downloadCMake-be32b258cb621d3845f4d33931adca8826f1c5b3.zip
CMake-be32b258cb621d3845f4d33931adca8826f1c5b3.tar.gz
CMake-be32b258cb621d3845f4d33931adca8826f1c5b3.tar.bz2
ENH: check return value of GetLongPath
Diffstat (limited to 'Source/kwsys/SystemTools.cxx')
-rw-r--r--Source/kwsys/SystemTools.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index a0e5e7e..7e925f1 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -2247,7 +2247,11 @@ kwsys_stl::string SystemTools::GetActualCaseForPath(const char* p)
return path;
}
char buffer[MAX_PATH+1];
- ::GetLongPathName(path.c_str(), buffer, MAX_PATH+1);
+ int len = ::GetLongPathName(path.c_str(), buffer, MAX_PATH+1);
+ if(len == 0 || len > MAX_PATH+1)
+ {
+ return path;
+ }
return buffer;
#endif
}