fix MwDirectoryOpen
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good

This commit is contained in:
Nishi 2026-09-12 06:45:45 +09:00
commit eb1db3a5e9

View file

@ -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);