summaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/string.c b/string.c
index e20007f0b..0a50f174f 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));