summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-11 08:36:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-11 08:36:20 +0000
commit099672568175997a8576744f560cd087f468f4e1 (patch)
tree73cf308b6725590278a458173df523a6e13beff7 /dir.c
parent66d927e308955fd82bd5cbddbe99dfb055d857be (diff)
* dir.c (rb_globi): also should call back via rb_glob_caller().
[ruby-dev:24775] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/dir.c b/dir.c
index 87f1252..e83435b 100644
--- a/dir.c
+++ b/dir.c
@@ -1099,13 +1099,12 @@ struct rb_glob_args {
VALUE arg;
};
-static VALUE
+static void
rb_glob_caller(path, a)
VALUE path, a;
{
struct rb_glob_args *args = (struct rb_glob_args *)a;
(*args->func)(RSTRING(path)->ptr, args->arg);
- return Qnil;
}
void
@@ -1119,7 +1118,7 @@ rb_glob(path, func, arg)
args.func = func;
args.arg = arg;
- status = rb_glob2(rb_str_new2(path), 0, rb_glob_caller, &args);
+ status = rb_glob2(rb_str_new2(path), 0, rb_glob_caller, (VALUE)&args);
if (status) rb_jump_tag(status);
}
@@ -1130,7 +1129,12 @@ rb_globi(path, func, arg)
void (*func) _((const char*, VALUE));
VALUE arg;
{
- int status = rb_glob2(path, FNM_CASEFOLD, func, arg);
+ struct rb_glob_args args;
+ int status;
+
+ args.func = func;
+ args.arg = arg;
+ status = rb_glob2(rb_str_new2(path), FNM_CASEFOLD, rb_glob_caller, (VALUE)&args);
if (status) rb_jump_tag(status);
}