ruby-changes:44535
From: nobu <ko1@a...>
Date: Sun, 6 Nov 2016 00:49:32 +0900 (JST)
Subject: [ruby-changes:44535] nobu:r56608 (trunk): dir.c: merge rb_glob2 into rb_glob
nobu 2016-11-06 00:49:29 +0900 (Sun, 06 Nov 2016) New Revision: 56608 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56608 Log: dir.c: merge rb_glob2 into rb_glob * dir.c (rb_glob): merge rb_glob2 which is used only here. Modified files: trunk/dir.c Index: dir.c =================================================================== --- dir.c (revision 56607) +++ dir.c (revision 56608) @@ -2044,29 +2044,18 @@ rb_glob_caller(const char *path, VALUE a https://github.com/ruby/ruby/blob/trunk/dir.c#L2044 return status; } -static int -rb_glob2(const char *path, int flags, - void (*func)(const char *, VALUE, void *), VALUE arg, - rb_encoding* enc) +void +rb_glob(const char *path, void (*func)(const char *, VALUE, void *), VALUE arg) { struct glob_args args; + int status; args.func = func; args.value = arg; - args.enc = enc; - - if (flags & FNM_SYSCASE) { - rb_warning("Dir.glob() ignores File::FNM_CASEFOLD"); - } - - return ruby_glob0(path, flags | GLOB_VERBOSE, rb_glob_caller, (VALUE)&args, - enc); -} + args.enc = rb_ascii8bit_encoding(); -void -rb_glob(const char *path, void (*func)(const char *, VALUE, void *), VALUE arg) -{ - int status = rb_glob2(path, 0, func, arg, rb_ascii8bit_encoding()); + status = ruby_glob0(path, GLOB_VERBOSE, rb_glob_caller, (VALUE)&args, + args.enc); if (status) GLOB_JUMP_TAG(status); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/