summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-01-21 07:43:41 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-01-21 07:43:41 +0000
commit4c2c8f099c305476c0361937c12f59fd5bfbc788 (patch)
treeaa9e156cbc680ee49ba0fa1bf9bd15d41676e7c9 /dir.c
parent551de15b61b773c3460e6b574df4ef4f7dc09807 (diff)
* eval.c (ruby_stop): should not trace error handler.
* io.c (io_write): should not raise exception on O_NONBLOCK io. * dir.c (dir_set_pos): seek should return dir, pos= should not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@2008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index 9feb48faf0..43ac5c715e 100644
--- a/dir.c
+++ b/dir.c
@@ -367,6 +367,14 @@ dir_seek(dir, pos)
}
static VALUE
+dir_set_pos(dir, pos)
+ VALUE dir, pos;
+{
+ dir_seek(dir, pos);
+ return dir;
+}
+
+static VALUE
dir_rewind(dir)
VALUE dir;
{
@@ -840,6 +848,7 @@ dir_s_glob(dir, str)
}
if (buf != buffer)
free(buf);
+ if (!ary) return Qnil;
return ary;
}
@@ -883,7 +892,7 @@ Init_Dir()
rb_define_method(rb_cDir,"tell", dir_tell, 0);
rb_define_method(rb_cDir,"seek", dir_seek, 1);
rb_define_method(rb_cDir,"pos", dir_tell, 0);
- rb_define_method(rb_cDir,"pos=", dir_seek, 1);
+ rb_define_method(rb_cDir,"pos=", dir_set_pos, 1);
rb_define_method(rb_cDir,"close", dir_close, 0);
rb_define_singleton_method(rb_cDir,"chdir", dir_s_chdir, -1);