summaryrefslogtreecommitdiff
path: root/compat/mingw.c
diff options
context:
space:
mode:
authorErik Faye-Lund <kusmabite@gmail.com>2010-11-23 18:38:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-11-24 00:06:47 (GMT)
commit9585ed519c59d5ac46f8e12b339220cdd0567b7d (patch)
tree3f182d4e555918abcae2cf4dc4b4821dd805ba4a /compat/mingw.c
parent20c6788aced1237489824db3b25285afed0ad169 (diff)
downloadgit-9585ed519c59d5ac46f8e12b339220cdd0567b7d.zip
git-9585ed519c59d5ac46f8e12b339220cdd0567b7d.tar.gz
git-9585ed519c59d5ac46f8e12b339220cdd0567b7d.tar.bz2
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>
Diffstat (limited to 'compat/mingw.c')
-rw-r--r--compat/mingw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index 29f4036..9f8f37f 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -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;
}