8000 merge revision(s) 16307: · documenting-ruby/ruby@e36c3c1 · GitHub
[go: up one dir, main page]

Skip to content

Commit e36c3c1

Browse files
committed
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
1 parent 2b24ed5 commit e36c3c1

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Sun Jun 15 22:43:39 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
2+
3+
* struct.c (rb_struct_s_def): to_str should be called only once.
4+
[ruby-core:16647]
5+
16
Sun Jun 15 22:41:49 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
27

38
* ext/zlib/zlib.c (gzreader_gets): may cause infinite loop.

struct.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -307,19 +307,14 @@ rb_struct_s_def(argc, argv, klass)
307307
ID id;
308308

309309
rb_scan_args(argc, argv, "1*", &name, &rest);
310+
if (!NIL_P(name) && SYMBOL_P(name)) {
311+
rb_ary_unshift(rest, name);
312+
name = Qnil;
313+
}
310314
for (i=0; i<RARRAY(rest)->len; i++) {
311315
id = rb_to_id(RARRAY(rest)->ptr[i]);
312316
RARRAY(rest)->ptr[i] = ID2SYM(id);
313317
}
314-
if (!NIL_P(name)) {
315-
VALUE tmp = rb_check_string_type(name);
316-
317-
if (NIL_P(tmp)) {
318-
id = rb_to_id(name);
319-
rb_ary_unshift(rest, ID2SYM(id));
320-
name = Qnil;
321-
}
322-
}
323318
st = make_struct(name, rest, klass);
324319
if (rb_block_given_p()) {
325320
rb_mod_module_eval(0, 0, st);

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define RUBY_RELEASE_DATE "2008-06-15"
33
#define RUBY_VERSION_CODE 185
44
#define RUBY_RELEASE_CODE 20080615
5-
#define RUBY_PATCHLEVEL 202
5+
#define RUBY_PATCHLEVEL 203
66

77
#define RUBY_VERSION_MAJOR 1
88
#define RUBY_VERSION_MINOR 8

0 commit comments

Comments
 (0)
0