summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c11
1 files changed, 7 insertions, 4 deletions
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