* win32/win32.c (rb_w32_stat): empty path is invalid, and return

ENOENT rather than EBADF in such case.  [ruby-talk:57177]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2002-12-01 13:47:06 +00:00
parent 59d4702438
commit c405dbf692
2 changed files with 9 additions and 5 deletions

View file

@ -2539,13 +2539,12 @@ rb_w32_stat(const char *path, struct stat *st)
*s = *p;
}
*s = '\0';
len = strlen(buf1);
p = CharPrev(buf1, buf1 + len);
if( '\"' == *(--s) )
{
errno = EBADF;
len = s - buf1;
if (!len || '\"' == *(--s)) {
errno = ENOENT;
return -1;
}
p = CharPrev(buf1, buf1 + len);
if (isUNCRoot(buf1)) {
if (*p != '\\')