summaryrefslogtreecommitdiffstats
path: root/Directory.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Directory.cxx')
-rw-r--r--Directory.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/Directory.cxx b/Directory.cxx
index d54e607..b305fd7 100644
--- a/Directory.cxx
+++ b/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