Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Commit

Permalink
dir.c: merge rb_glob2 into rb_glob
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
nobu committed Nov 5, 2016
1 parent 7c7444b commit a44c3bb
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions dir.c
Expand Up @@ -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);
}

Expand Down

0 comments on commit a44c3bb

Please sign in to comment.