Fix DirectoryScanner implementation bugs
Fixed several bugs in the DirectoryScanner implementation: Windows fixes: - Fixed snprintf call missing buffer size parameter - Fixed FindFirstFileA to use pattern (with wildcard) instead of path - Changed sys_GetLastError() to GetLastError() - Added scanner->first = false after using first result - Removed TODO comment from cFileName usage (it's the correct field) Linux fixes: - Fixed typo: sys_reddir → sys_readdir - Added missing 'done' field to DirectoryScanner struct - Initialize scanner->done = false on successful opendir - Fixed return value when scanner->done (should return 1, not -1)
This commit is contained in:
@@ -18,6 +18,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
DIR *d;
|
||||
struct dirent *e;
|
||||
bool done;
|
||||
} DirectoryScanner;
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user