summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 13:44:09 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 13:44:09 +0000
commite36c3c1ddb7678b7641f936961412110b8d3d5be (patch)
tree8e462ff4550788b90e63d67c444c9ccfbfc27fc4
parent2b24ed556f43668d91a162b752a65f211e57559c (diff)
merge revision(s) 16307:
* struct.c (rb_struct_s_def): to_str should be called only once. [ruby-core:16647] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@17276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--struct.c13
-rw-r--r--version.h2
3 files changed, 10 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 451f9d1700..6e6d59687e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Jun 15 22:43:39 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * struct.c (rb_struct_s_def): to_str should be called only once.
+ [ruby-core:16647]
+
Sun Jun 15 22:41:49 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/zlib/zlib.c (gzreader_gets): may cause infinite loop.
diff --git a/struct.c b/struct.c
index 0dd5aba0a0..0e2b26f8fc 100644
--- a/struct.c
+++ b/struct.c
@@ -307,19 +307,14 @@ rb_struct_s_def(argc, argv, klass)
ID id;
rb_scan_args(argc, argv, "1*", &name, &rest);
+ if (!NIL_P(name) && SYMBOL_P(name)) {
+ rb_ary_unshift(rest, name);
+ name = Qnil;
+ }
for (i=0; i<RARRAY(rest)->len; i++) {
id = rb_to_id(RARRAY(rest)->ptr[i]);
RARRAY(rest)->ptr[i] = ID2SYM(id);
}
- if (!NIL_P(name)) {
- VALUE tmp = rb_check_string_type(name);
-
- if (NIL_P(tmp)) {
- id = rb_to_id(name);
- rb_ary_unshift(rest, ID2SYM(id));
- name = Qnil;
- }
- }
st = make_struct(name, rest, klass);
if (rb_block_given_p()) {
rb_mod_module_eval(0, 0, st);
diff --git a/version.h b/version.h
index c653eb8950..91c5a7199c 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2008-06-15"
#define RUBY_VERSION_CODE 185
#define RUBY_RELEASE_CODE 20080615
-#define RUBY_PATCHLEVEL 202
+#define RUBY_PATCHLEVEL 203
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8