summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/Directory.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-07-07 13:04:27 (GMT)
committerBrad King <brad.king@kitware.com>2014-07-07 13:04:27 (GMT)
commit5f525da0e3d4f6c50cc24a93cc792ee025939701 (patch)
tree71710f8f8985d5a0e71f490a331ba3035a1c572e /Source/kwsys/Directory.cxx
parent61be345115b5f2c402286be7fa3e6df0c2f5f0ac (diff)
parent3d127627f8e28d97ecc44515e274b3780ae3f4b9 (diff)
downloadCMake-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.cxx13
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