1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* dir.c (push_glob): str should be a string always.

* dir.c (rb_push_glob, dir_globs): use #to_path to convert non-
  string values.  cf. [ruby-dev:39345]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-09-17 21:47:14 +00:00
parent 80464f8f2a
commit 12fc299a84
2 changed files with 10 additions and 3 deletions

View file

@ -1,3 +1,10 @@
Fri Sep 18 06:47:13 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* dir.c (push_glob): str should be a string always.
* dir.c (rb_push_glob, dir_globs): use #to_path to convert non-
string values. cf. [ruby-dev:39345]
Fri Sep 18 06:36:51 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> Fri Sep 18 06:36:51 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (rm_f, rm_rf): FileUtils.rm can take an array. * lib/mkmf.rb (rm_f, rm_rf): FileUtils.rm can take an array.

6
dir.c
View file

@ -1613,7 +1613,7 @@ push_glob(VALUE ary, VALUE str, int flags)
args.value = ary; args.value = ary;
args.enc = enc; args.enc = enc;
return ruby_brace_glob0(StringValuePtr(str), flags | GLOB_VERBOSE, return ruby_brace_glob0(RSTRING_PTR(str), flags | GLOB_VERBOSE,
rb_glob_caller, (VALUE)&args, enc); rb_glob_caller, (VALUE)&args, enc);
} }
@ -1623,7 +1623,7 @@ rb_push_glob(VALUE str, int flags) /* '\0' is delimiter */
long offset = 0; long offset = 0;
VALUE ary; VALUE ary;
StringValue(str); FilePathValue(str);
ary = rb_ary_new(); ary = rb_ary_new();
while (offset < RSTRING_LEN(str)) { while (offset < RSTRING_LEN(str)) {
@ -1653,7 +1653,7 @@ dir_globs(long argc, VALUE *argv, int flags)
for (i = 0; i < argc; ++i) { for (i = 0; i < argc; ++i) {
int status; int status;
VALUE str = argv[i]; VALUE str = argv[i];
SafeStringValue(str); FilePathValue(str);
status = push_glob(ary, str, flags); status = push_glob(ary, str, flags);
if (status) GLOB_JUMP_TAG(status); if (status) GLOB_JUMP_TAG(status);
} }