summaryrefslogtreecommitdiff
path: root/compat/msvc.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-12-13 05:49:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-12-13 05:49:52 (GMT)
commit1e86274cd4e544628d5f6e327eb62094051e7948 (patch)
tree93da98aa1cf2d76c0a1caf3266ff36e8d2a3de12 /compat/msvc.c
parentcd425a1585bf0c1b92faa772b664dadd3294bf19 (diff)
parentd1b6e6e015501272c7491b3a4adf3cd3904edefa (diff)
downloadgit-1e86274cd4e544628d5f6e327eb62094051e7948.zip
git-1e86274cd4e544628d5f6e327eb62094051e7948.tar.gz
git-1e86274cd4e544628d5f6e327eb62094051e7948.tar.bz2
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.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/compat/msvc.c b/compat/msvc.c
index ac04a4c..71843d7 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"