aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mingw.h6
-rw-r--r--win32/mingw.c15
2 files changed, 21 insertions, 0 deletions
diff --git a/include/mingw.h b/include/mingw.h
index c15161483..6d494b7ef 100644
--- a/include/mingw.h
+++ b/include/mingw.h
@@ -435,6 +435,12 @@ int mingw_rmdir(const char *name);
435int utimes(const char *file_name, const struct timeval times[2]); 435int utimes(const char *file_name, const struct timeval times[2]);
436 436
437/* 437/*
438 * dirent.h
439 */
440DIR *mingw_opendir(const char *path);
441#define opendir mingw_opendir
442
443/*
438 * MinGW specific 444 * MinGW specific
439 */ 445 */
440#define is_dir_sep(c) ((c) == '/' || (c) == '\\') 446#define is_dir_sep(c) ((c) == '/' || (c) == '\\')
diff --git a/win32/mingw.c b/win32/mingw.c
index 14cfdd992..876b74221 100644
--- a/win32/mingw.c
+++ b/win32/mingw.c
@@ -986,3 +986,18 @@ char *file_is_win32_executable(const char *p)
986 986
987 return NULL; 987 return NULL;
988} 988}
989
990#undef opendir
991DIR *mingw_opendir(const char *path)
992{
993 char name[4];
994
995 if (isalpha(path[0]) && path[1] == ':' && path[2] == '\0') {
996 strcpy(name, path);
997 name[2] = '/';
998 name[3] = '\0';
999 path = name;
1000 }
1001
1002 return opendir(path);
1003}