summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-05 15:49:29 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-05 15:49:29 +0000
commita44c3bb26f9f32e6f5a63c80f5d6a7ef096caec5 (patch)
tree52bb0fb384f03b41aed99f169ff39f658d3403e3 /dir.c
parent7c7444bcd3f40d0594aa24875f66519b6c53fccf (diff)
dir.c: merge rb_glob2 into rb_glob
* dir.c (rb_glob): merge rb_glob2 which is used only here. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/dir.c b/dir.c
index dca83ed..f701fe9 100644
--- a/dir.c
+++ b/dir.c
@@ -2044,29 +2044,18 @@ rb_glob_caller(const char *path, VALUE a, void *enc)
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");
- }
+ args.enc = rb_ascii8bit_encoding();
- return ruby_glob0(path, flags | GLOB_VERBOSE, rb_glob_caller, (VALUE)&args,
- enc);
-}
-
-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);
}