diff options
author | Brad King <brad.king@kitware.com> | 2015-04-13 13:01:59 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-04-13 13:01:59 (GMT) |
commit | e538858349527efc1cf3ebcfb824b114964262df (patch) | |
tree | b011ec4e4fb7c77aabc8651ea3c3106a75987581 /Source/kwsys/SystemTools.cxx | |
parent | 10859b97ebbe610a829e3981958d7b4c0149f95a (diff) | |
parent | d34d5a370ec656aab6f980218d74002789fedfff (diff) | |
download | CMake-e538858349527efc1cf3ebcfb824b114964262df.zip CMake-e538858349527efc1cf3ebcfb824b114964262df.tar.gz CMake-e538858349527efc1cf3ebcfb824b114964262df.tar.bz2 |
Merge branch 'upstream-kwsys' into update-kwsys
Diffstat (limited to 'Source/kwsys/SystemTools.cxx')
-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( |