diff options
author | KWSys Robot <kwrobot@kitware.com> | 2015-04-10 12:55:18 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-04-13 13:01:55 (GMT) |
commit | d34d5a370ec656aab6f980218d74002789fedfff (patch) | |
tree | bd9b00c78b210b7fb22c8e2f1c84ae9c96f6d7d5 | |
parent | bc67dbede991be9238e8a102bfb026054b48d83d (diff) | |
download | CMake-d34d5a370ec656aab6f980218d74002789fedfff.zip CMake-d34d5a370ec656aab6f980218d74002789fedfff.tar.gz CMake-d34d5a370ec656aab6f980218d74002789fedfff.tar.bz2 |
KWSys 2015-04-10 (69bccf2e)
Extract upstream KWSys using the following shell commands.
$ git archive --prefix=upstream-kwsys/ 69bccf2e | tar x
$ git shortlog --no-merges --abbrev=8 --format='%h %s' 9367a33b..69bccf2e
Brad King (1):
69bccf2e SystemTools: Teach Touch with !create to succeed on missing file
Change-Id: I4af502542578b6a16ca4ddffb03553a046378e56
-rw-r--r-- | SystemTools.cxx | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/SystemTools.cxx b/SystemTools.cxx index 8a481d6..6c4a7a6 100644 --- a/SystemTools.cxx +++ b/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( |