From 099672568175997a8576744f560cd087f468f4e1 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 11 Nov 2004 08:36:20 +0000 Subject: * 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 --- dir.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'dir.c') diff --git a/dir.c b/dir.c index 87f1252598..e83435b14d 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); } -- cgit v1.2.3