Skip to content

Commit

Permalink
* win32/win32.c (win32_stat): empty path is invalid, and return
Browse files Browse the repository at this point in the history
  ENOENT rather than EBADF in such case.  [ruby-talk:57177]


git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_6@3101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Dec 1, 2002
1 parent 3a0e8db commit 1680a56
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
Sun Dec 1 22:43:29 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>

* win32/win32.c (win32_stat): empty path is invalid, and return
ENOENT rather than EBADF in such case. [ruby-talk:57177]

Wed Nov 27 17:42:56 2002 Akinori MUSHA <knu@iDaemons.org>

* ext/syslog/syslog.c: Cut redundancy.
Expand Down
9 changes: 4 additions & 5 deletions win32/win32.c
Expand Up @@ -2629,13 +2629,12 @@ win32_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 != '\\')
Expand Down

0 comments on commit 1680a56

Please sign in to comment.