win32: dirent: handle errors
Previously all error conditions were ignored. Be nice, and set errno when we should. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
20c6788ace
commit
9585ed519c
@ -1582,7 +1582,7 @@ struct dirent *mingw_readdir(DIR *dir)
|
||||
HANDLE handle;
|
||||
struct mingw_DIR *mdir = (struct mingw_DIR*)dir;
|
||||
|
||||
if (!dir->dd_handle) {
|
||||
if (!dir || !dir->dd_handle) {
|
||||
errno = EBADF; /* No set_errno for mingw */
|
||||
return NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user