diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-12-12 21:49:52 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-12-12 21:49:52 -0800 |
commit | 1e86274cd4e544628d5f6e327eb62094051e7948 (patch) | |
tree | 93da98aa1cf2d76c0a1caf3266ff36e8d2a3de12 /compat/msvc.c | |
parent | Merge branch 'mz/rebase-i-verify' (diff) | |
parent | win32: use our own dirent.h (diff) | |
download | tgif-1e86274cd4e544628d5f6e327eb62094051e7948.tar.xz |
Merge branch 'ef/win32-dirent'
* ef/win32-dirent:
win32: use our own dirent.h
msvc: opendir: handle paths ending with a slash
win32: dirent: handle errors
msvc: opendir: do not start the search
msvc: opendir: allocate enough memory
msvc: opendir: fix malloc-failure
Conflicts:
Makefile
Diffstat (limited to 'compat/msvc.c')
-rw-r--r-- | compat/msvc.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/compat/msvc.c b/compat/msvc.c index ac04a4ccbd..71843d7eef 100644 --- a/compat/msvc.c +++ b/compat/msvc.c @@ -3,33 +3,4 @@ #include <conio.h> #include "../strbuf.h" -DIR *opendir(const char *name) -{ - int len; - DIR *p; - p = (DIR*)malloc(sizeof(DIR)); - memset(p, 0, sizeof(DIR)); - strncpy(p->dd_name, name, PATH_MAX); - len = strlen(p->dd_name); - p->dd_name[len] = '/'; - p->dd_name[len+1] = '*'; - - if (p == NULL) - return NULL; - - p->dd_handle = _findfirst(p->dd_name, &p->dd_dta); - - if (p->dd_handle == -1) { - free(p); - return NULL; - } - return p; -} -int closedir(DIR *dir) -{ - _findclose(dir->dd_handle); - free(dir); - return 0; -} - #include "mingw.c" |