diff options
author | Jeremy Evans <[email protected]> | 2021-08-10 14:19:33 -0700 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2021-08-11 13:40:49 +0900 |
commit | 84bf4d2ce55e16a4fb51b407a8c9c79e583596b3 (patch) | |
tree | a13e496edcc48b2724eb399702523eb831393492 /string.c | |
parent | a0a8f2abf533702b2cd96e79f700ce5b9cd94f50 (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.c | 6 |
1 files changed, 0 insertions, 6 deletions
@@ -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; |