summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-17 21:47:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-17 21:47:14 +0000
commit9500f30dce0f24acc8c0f995a686ba65da1c6eaa (patch)
tree0a431720e28b6b10aa20f1974ce585fce09d292f
parenta1582ade5e8a18e2bcfbc1dc1aeecfbf36fa79e1 (diff)
downloadruby-9500f30dce0f24acc8c0f995a686ba65da1c6eaa.tar.gz
ruby-9500f30dce0f24acc8c0f995a686ba65da1c6eaa.tar.xz
ruby-9500f30dce0f24acc8c0f995a686ba65da1c6eaa.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@24985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--dir.c6
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index fbe80dbc8..14a934a76 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* lib/mkmf.rb (rm_f, rm_rf): FileUtils.rm can take an array.
diff --git a/dir.c b/dir.c
index 4e20230a6..e9f9d6116 100644
--- a/dir.c
+++ b/dir.c
@@ -1613,7 +1613,7 @@ push_glob(VALUE ary, VALUE str, int flags)
args.value = ary;
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);
}
@@ -1623,7 +1623,7 @@ rb_push_glob(VALUE str, int flags) /* '\0' is delimiter */
long offset = 0;
VALUE ary;
- StringValue(str);
+ FilePathValue(str);
ary = rb_ary_new();
while (offset < RSTRING_LEN(str)) {
@@ -1653,7 +1653,7 @@ dir_globs(long argc, VALUE *argv, int flags)
for (i = 0; i < argc; ++i) {
int status;
VALUE str = argv[i];
- SafeStringValue(str);
+ FilePathValue(str);
status = push_glob(ary, str, flags);
if (status) GLOB_JUMP_TAG(status);
}