diff options
author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-04-01 16:22:13 +0000 |
---|---|---|
committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-04-01 16:22:13 +0000 |
commit | 2ed9c79bbbb9616376f6e76409fbfecb2bb182a4 (patch) | |
tree | d4d201f94f577bc8991790bc5461c561d78278aa | |
parent | 8de229963c5de74b53fbdb84367f00d86c719b0a (diff) |
* win32/win32.c: use ruby's opendir on mingw32.
* win32/dir.h, dir.c, Makefile: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | Makefile.in | 2 | ||||
-rw-r--r-- | dir.c | 6 | ||||
-rw-r--r-- | win32/win32.c | 4 |
4 files changed, 11 insertions, 7 deletions
@@ -1,3 +1,9 @@ +Mon Apr 2 01:16:24 2001 WATANABE Hirofumi <eban@ruby-lang.org> + + * win32/win32.c: use ruby's opendir on mingw32. + + * win32/dir.h, dir.c, Makefile: ditto. + Sat Mar 31 04:47:55 2001 Shugo Maeda <shugo@ruby-lang.org> * lib/net/imap.rb: add document and example code. diff --git a/Makefile.in b/Makefile.in index 0fa87aa44f..163a4156b4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -231,7 +231,7 @@ dl_os2.@OBJEXT@: $(srcdir)/missing/dl_os2.c $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/missing/dl_os2.c win32.@OBJEXT@: $(srcdir)/win32/win32.c - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/win32/win32.c + $(CC) $(CFLAGS) $(CPPFLAGS) -I$(srcdir)/win32 -c $(srcdir)/win32/win32.c # Prevent GNU make v3 from overflowing arg limit on SysV. .NOEXPORT: @@ -26,10 +26,10 @@ #include <unistd.h> #endif -#if HAVE_DIRENT_H +#if defined HAVE_DIRENT_H && !defined NT # include <dirent.h> # define NAMLEN(dirent) strlen((dirent)->d_name) -#elif HAVE_DIRECT_H +#elif defined HAVE_DIRECT_H && !defined NT # include <direct.h> # define NAMLEN(dirent) strlen((dirent)->d_name) #else @@ -44,7 +44,7 @@ # if HAVE_NDIR_H # include <ndir.h> # endif -# if defined(NT) && defined(_MSC_VER) +# if defined(NT) # include "win32/dir.h" # endif #endif diff --git a/win32/win32.c b/win32/win32.c index 54ad44ae33..a1f795d97e 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1321,7 +1321,6 @@ NtMakeCmdVector (char *cmdline, char ***vec, int InputCmd) } -#if !defined __MINGW32__ // // UNIX compatible directory access functions for NT // @@ -1350,7 +1349,7 @@ opendir(const char *filename) // check to see if we\'ve got a directory // - if ((stat (filename, &sbuf) < 0 || + if ((win32_stat (filename, &sbuf) < 0 || sbuf.st_mode & _S_IFDIR == 0) && (!ISALPHA(filename[0]) || filename[1] != ':' || filename[2] != '\0' || ((1 << (filename[0] & 0x5f) - 'A') & GetLogicalDrives()) == 0)) { @@ -1507,7 +1506,6 @@ closedir(DIR *dirp) free(dirp->start); free(dirp); } -#endif // |