From 740e1b66c8e42ef63bbf5043e349f80855cbec14 Mon Sep 17 00:00:00 2001 From: kou Date: Sat, 15 Sep 2007 09:26:06 +0000 Subject: [PATCH] * string.c (rb_str_rstrip_bang): fixed too much rstrip. [ruby-dev:31786] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ string.c | 1 + 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index f4418d092a..bccf408a44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat Sep 15 18:25:15 2007 Kouhei Sutou + + * string.c (rb_str_rstrip_bang): fixed too much rstrip. [ruby-dev:31786] + Sat Sep 15 17:32:10 2007 Nobuyoshi Nakada * parse.y (parser_initialize): set default encoding. [ruby-dev:31787] diff --git a/string.c b/string.c index e20007f0b9..0a50f174fe 100644 --- a/string.c +++ b/string.c @@ -4374,6 +4374,7 @@ rb_str_rstrip_bang(VALUE str) } s += rb_enc_codelen(cc, enc); } + if (!space_seen) t = s; if (t < e) { rb_str_modify(str); STR_SET_LEN(str, t-RSTRING_PTR(str));