fix MwDirectoryOpen
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
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;
|
||||
}
|
||||
#ifdef _WIN32
|
||||
p = MwStringDuplicate(path);
|
||||
p = malloc(strlen(path) + 2 + 1);
|
||||
|
||||
strcpy(p, path);
|
||||
if(strchr(path, '/') != NULL) {
|
||||
MwStringConcat(p, "/");
|
||||
strcat(p, "/");
|
||||
} else {
|
||||
MwStringConcat(p, "\\");
|
||||
strcat(p, "\\");
|
||||
}
|
||||
MwStringConcat(p, "*");
|
||||
strcat(p, "*");
|
||||
if((dir->hFind = FindFirstFile(p, &dir->ffd)) == INVALID_HANDLE_VALUE) {
|
||||
free(p);
|
||||
free(dir);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue