summaryrefslogtreecommitdiffstats
path: root/win32/win32.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-17 12:30:15 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-17 12:30:15 +0000
commitd0ba5ecff28f3c13445e29795a322f5576bacbee (patch)
tree1b63492b9cc64286263f7b75110dac607145b40b /win32/win32.c
parent143e97eabfee78c30b290c6003ff5839b974d5ae (diff)
downloadruby-d0ba5ecff28f3c13445e29795a322f5576bacbee.tar.gz
ruby-d0ba5ecff28f3c13445e29795a322f5576bacbee.tar.xz
ruby-d0ba5ecff28f3c13445e29795a322f5576bacbee.zip
* win32/win32.c (rb_w32_opendir): need to set errno. [ruby-talk:73761]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/win32.c')
-rw-r--r--win32/win32.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 7fa962f15..d819dba2e 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1333,7 +1333,9 @@ rb_w32_opendir(const char *filename)
// check to see if we've got a directory
//
- if ((rb_w32_stat(filename, &sbuf) < 0 || (
+ if (rb_w32_stat(filename, &sbuf) < 0)
+ return NULL;
+ if (((
#ifdef __BORLANDC__
(unsigned short)(sbuf.st_mode)
#else
@@ -1342,6 +1344,7 @@ rb_w32_opendir(const char *filename)
& _S_IFDIR) == 0) &&
(!ISALPHA(filename[0]) || filename[1] != ':' || filename[2] != '\0' ||
((1 << (filename[0] & 0x5f) - 'A') & GetLogicalDrives()) == 0)) {
+ errno = ENOTDIR;
return NULL;
}