summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2021-08-10 14:19:33 -0700
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-08-11 13:40:49 +0900
commit84bf4d2ce55e16a4fb51b407a8c9c79e583596b3 (patch)
treea13e496edcc48b2724eb399702523eb831393492 /string.c
parenta0a8f2abf533702b2cd96e79f700ce5b9cd94f50 (diff)
Term fill in String#{,l,r}strip! even when SHARABLE_MIDDLE_SUBSTRING
Each of these methods calls str_modify_keep_cr before term filling, which should ensure the backing string uses private memory, and therefore term filling should not affect other strings. Skipping the term filling was added in a707ab4bc8a29241440f56696098efa2f7f3ff45. Fixes [Bug #12540]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4731
Diffstat (limited to 'string.c')
-rw-r--r--string.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/string.c b/string.c
index 0575aa86ce..8efe1174fb 100644
--- a/string.c
+++ b/string.c
@@ -9322,9 +9322,7 @@ rb_str_lstrip_bang(VALUE str)
s = start + loffset;
memmove(start, s, len);
STR_SET_LEN(str, len);
-#if !SHARABLE_MIDDLE_SUBSTRING
TERM_FILL(start+len, rb_enc_mbminlen(enc));
-#endif
return str;
}
return Qnil;
@@ -9411,9 +9409,7 @@ rb_str_rstrip_bang(VALUE str)
long len = olen - roffset;
STR_SET_LEN(str, len);
-#if !SHARABLE_MIDDLE_SUBSTRING
TERM_FILL(start+len, rb_enc_mbminlen(enc));
-#endif
return str;
}
return Qnil;
@@ -9482,9 +9478,7 @@ rb_str_strip_bang(VALUE str)
memmove(start, start + loffset, len);
}
STR_SET_LEN(str, len);
-#if !SHARABLE_MIDDLE_SUBSTRING
TERM_FILL(start+len, rb_enc_mbminlen(enc));
-#endif
return str;
}
return Qnil;