diff options
author | Brad King <brad.king@kitware.com> | 2014-07-07 13:04:27 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-07-07 13:04:27 (GMT) |
commit | 5f525da0e3d4f6c50cc24a93cc792ee025939701 (patch) | |
tree | 71710f8f8985d5a0e71f490a331ba3035a1c572e /Source/kwsys/Directory.cxx | |
parent | 61be345115b5f2c402286be7fa3e6df0c2f5f0ac (diff) | |
parent | 3d127627f8e28d97ecc44515e274b3780ae3f4b9 (diff) | |
download | CMake-5f525da0e3d4f6c50cc24a93cc792ee025939701.zip CMake-5f525da0e3d4f6c50cc24a93cc792ee025939701.tar.gz CMake-5f525da0e3d4f6c50cc24a93cc792ee025939701.tar.bz2 |
Merge branch 'upstream-kwsys' into update-kwsys
Diffstat (limited to 'Source/kwsys/Directory.cxx')
-rw-r--r-- | Source/kwsys/Directory.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Source/kwsys/Directory.cxx b/Source/kwsys/Directory.cxx index d54e607..b305fd7 100644 --- a/Source/kwsys/Directory.cxx +++ b/Source/kwsys/Directory.cxx @@ -113,15 +113,24 @@ bool Directory::Load(const char* name) #endif char* buf; size_t n = strlen(name); - if ( name[n - 1] == '/' ) + if ( name[n - 1] == '/' || name[n - 1] == '\\' ) { buf = new char[n + 1 + 1]; sprintf(buf, "%s*", name); } else { + // Make sure the slashes in the wildcard suffix are consistent with the + // rest of the path buf = new char[n + 2 + 1]; - sprintf(buf, "%s/*", name); + if ( strchr(name, '\\') ) + { + sprintf(buf, "%s\\*", name); + } + else + { + sprintf(buf, "%s/*", name); + } } struct _wfinddata_t data; // data of current file |