From 362c468cceba21361da888d51460335e223366a4 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 14 Apr 2003 09:04:43 +0000 Subject: * rubyio.h (struct OpenFile): add error raise flag to finalizer. * io.c (Init_IO): define $/, $-0, and $\ as string-only variables. * string.c (rb_str_split_m): does not generate empty string if there's no match in the receiver. * io.c (fptr_finalize): should raise error on EBADF for readable IOs as well. * file.c (rb_stat): use rb_check_convert_type() to retrieve IO. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3679 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 35cfb3943..733a7dfc3 100644 --- a/string.c +++ b/string.c @@ -2613,7 +2613,7 @@ rb_str_split_m(argc, argv, str) if (!NIL_P(limit) && lim <= ++i) break; } } - if (!NIL_P(limit) || RSTRING(str)->len > beg || lim < 0) { + if (RSTRING(str)->len > 0 && (!NIL_P(limit) || RSTRING(str)->len > beg || lim < 0)) { if (RSTRING(str)->len == beg) tmp = rb_str_new5(str, 0, 0); else -- cgit