forked from pyrite-dev/milsko
fix MwDirectoryOpen
This commit is contained in:
parent
77e652cddc
commit
eb1db3a5e9
1 changed files with 6 additions and 4 deletions
|
|
@ -25,13 +25,15 @@ void* MwDirectoryOpen(const char* path) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
p = MwStringDuplicate(path);
|
p = malloc(strlen(path) + 2 + 1);
|
||||||
|
|
||||||
|
strcpy(p, path);
|
||||||
if(strchr(path, '/') != NULL) {
|
if(strchr(path, '/') != NULL) {
|
||||||
MwStringConcat(p, "/");
|
strcat(p, "/");
|
||||||
} else {
|
} else {
|
||||||
MwStringConcat(p, "\\");
|
strcat(p, "\\");
|
||||||
}
|
}
|
||||||
MwStringConcat(p, "*");
|
strcat(p, "*");
|
||||||
if((dir->hFind = FindFirstFile(p, &dir->ffd)) == INVALID_HANDLE_VALUE) {
|
if((dir->hFind = FindFirstFile(p, &dir->ffd)) == INVALID_HANDLE_VALUE) {
|
||||||
free(p);
|
free(p);
|
||||||
free(dir);
|
free(dir);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue