From a7a7324ea645b881658fb78d2e7e049f48970afd Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 18 Jan 2002 14:24:01 +0000 Subject: * io.c (rb_io_s_new): block check moved from initialize to this method. * io.c (rb_io_s_open): open should call initialize too. IO#for_fd also calls initialize. [new] * error.c (rb_sys_fail): replace INT2FIX() by INT2NUM() since errno value may not fit in Fixnum size on Hurd. * error.c (set_syserr): ditto. * dir.c (dir_s_glob): returns nil if block given. * io.c (rb_io_each_byte): should return self. * io.c (rb_io_close_m): close check added. * dir.c (dir_seek): should return pos. * parse.y (fixpos): orig may be (NODE*)1, which should not be dereferenced. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- dir.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'dir.c') diff --git a/dir.c b/dir.c index a7673175e5..e95c0cecb9 100644 --- a/dir.c +++ b/dir.c @@ -389,7 +389,7 @@ dir_seek(dir, pos) #ifdef HAVE_SEEKDIR GetDIR(dir, dirp); seekdir(dirp->dir, NUM2INT(pos)); - return dir; + return pos; #else rb_notimplement(); #endif @@ -930,10 +930,13 @@ dir_s_glob(dir, str) } if (buf != buffer) free(buf); - if (ary && RARRAY(ary)->len == 0) { - rb_warning("no matches found: %s", RSTRING(str)->ptr); + if (ary) { + if (RARRAY(ary)->len == 0) { + rb_warning("no matches found: %s", RSTRING(str)->ptr); + } + return ary; } - return ary; + return Qnil; } static VALUE -- cgit v1.2.3