aboutsummaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2015-09-30 11:13:38 +0100
committerRon Yorston <rmy@pobox.com>2015-09-30 11:13:38 +0100
commit249f68e3ceaaabdd40964f8ab85645da529ec469 (patch)
treec5ff54b43b5d4c093b8a9d7a910a2bb2e8a68503 /win32
parent336c09e79815ba8dce842c7e70da2bc06700e929 (diff)
downloadbusybox-w32-249f68e3ceaaabdd40964f8ab85645da529ec469.tar.gz
busybox-w32-249f68e3ceaaabdd40964f8ab85645da529ec469.tar.bz2
busybox-w32-249f68e3ceaaabdd40964f8ab85645da529ec469.zip
win32: append '/' to bare drive name in opendir
Make 'ls c:' and 'ls c:/*' do the right thing.
Diffstat (limited to 'win32')
-rw-r--r--win32/mingw.c15
1 files changed, 15 insertions, 0 deletions
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}