From: nobu@... Date: 2004-11-11T15:45:29+09:00 Subject: [ruby-dev:24775] Re: [ruby-cvs] ruby/lib, ruby/ext/socket, ruby: * dir.c (rb_glob2): do not allocate buffer from heap to avoid なかだです。 At Thu, 11 Nov 2004 09:05:53 +0900, Yukihiro Matsumoto wrote in [ruby-dev:24773]: > |rb_glob()のインタフェースは変えなかったつもりだったんですが、 > |ミスってたってことですかね。 > > と思ったら、案の定ミスってました。 まだ{,}が効きません。と書こうとしたら直ってるようですが、まだ rb_globi()が残っているのと、警告がいくつか。 Index: dir.c =================================================================== RCS file: /cvs/ruby/src/ruby/dir.c,v retrieving revision 1.92.2.16 diff -u -2 -p -r1.92.2.16 dir.c --- dir.c 11 Nov 2004 05:55:02 -0000 1.92.2.16 +++ dir.c 11 Nov 2004 06:41:37 -0000 @@ -1100,5 +1100,5 @@ struct rb_glob_args { }; -static VALUE +static void rb_glob_caller(path, a) VALUE path, a; @@ -1106,5 +1106,4 @@ rb_glob_caller(path, a) struct rb_glob_args *args = (struct rb_glob_args *)a; (*args->func)(RSTRING(path)->ptr, args->arg); - return Qnil; } @@ -1120,5 +1119,5 @@ 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); @@ -1131,5 +1130,10 @@ rb_globi(path, func, arg) 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); -- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦