diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-05 15:49:29 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-05 15:49:29 +0000 |
commit | a44c3bb26f9f32e6f5a63c80f5d6a7ef096caec5 (patch) | |
tree | 52bb0fb384f03b41aed99f169ff39f658d3403e3 /dir.c | |
parent | 7c7444bcd3f40d0594aa24875f66519b6c53fccf (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.c | 23 |
1 files changed, 6 insertions, 17 deletions
@@ -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); } |