From 73cd3df3cbd260aeff851ec2c07553f1d351109d Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 25 Sep 2002 07:03:05 +0000 Subject: * io.c (appendline): forget to terminate with nul. * eval.c (ruby_run): should set toplevel visibility again here. * eval.c (rb_eval): should not rely on ruby_class == rb_cObject check. Besides allow implicit publicity for attribute set methods. * parse.y (primary): need not to check class_nest, just set whether method is an attrset or not. * string.c (rb_str_each_line): p might be at the top of the string. * class.c (rb_make_metaclass): class of metaclass should be metaclass of superclass, unless class itself is a metaclass; class of metaclass of metaclass should point back to self. eh, confusing, isn't it. * class.c (rb_singleton_class): check if its class is singleton AND attached to self. * eval.c (rb_eval): should define class/module under ruby_cbase. * eval.c (rb_eval): should set class/module path based on ruby_cbase, not ruby_class. * eval.c (module_setup): use ruby_cbase instead of ruby_class. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'string.c') diff --git a/string.c b/string.c index 161c8a989..5b60e9268 100644 --- a/string.c +++ b/string.c @@ -2631,7 +2631,7 @@ rb_str_each_line(argc, argv, str) if (*++p != '\n') continue; while (*p == '\n') p++; } - if (p[-1] == newline && + if (RSTRING(str)->ptr < p && p[-1] == newline && (rslen <= 1 || rb_memcmp(RSTRING(rs)->ptr, p-rslen, rslen) == 0)) { line = rb_str_new5(str, s, p - s); -- cgit