diff options
author | Brad King <brad.king@kitware.com> | 2015-04-13 13:05:06 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-04-13 13:05:06 (GMT) |
commit | 2cf5415d9f6e94da3f64502a57fed957d3516fc3 (patch) | |
tree | f159089a4d9e32aeeca8d32aff3603f5c4b6d694 /Source | |
parent | 74c8b9284469dcc8b5a1e7fe23dae1bdc7aad468 (diff) | |
parent | e538858349527efc1cf3ebcfb824b114964262df (diff) | |
download | CMake-2cf5415d9f6e94da3f64502a57fed957d3516fc3.zip CMake-2cf5415d9f6e94da3f64502a57fed957d3516fc3.tar.gz CMake-2cf5415d9f6e94da3f64502a57fed957d3516fc3.tar.bz2 |
Merge topic 'update-kwsys'
e5388583 Merge branch 'upstream-kwsys' into update-kwsys
d34d5a37 KWSys 2015-04-10 (69bccf2e)
Diffstat (limited to 'Source')
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 8a481d6..6c4a7a6 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -1260,15 +1260,22 @@ bool SystemTools::PathCygwinToWin32(const char *path, char *win32_path) bool SystemTools::Touch(const kwsys_stl::string& filename, bool create) { - if(create && !SystemTools::FileExists(filename)) + if (!SystemTools::FileExists(filename)) { - FILE* file = Fopen(filename, "a+b"); - if(file) + if(create) + { + FILE* file = Fopen(filename, "a+b"); + if(file) + { + fclose(file); + return true; + } + return false; + } + else { - fclose(file); return true; } - return false; } #if defined(_WIN32) && !defined(__CYGWIN__) HANDLE h = CreateFileW( |