aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--string.c1
-rw-r--r--test/ruby/test_string.rb5
2 files changed, 6 insertions, 0 deletions
diff --git a/string.c b/string.c
index e1bd9a052e..0c782a430f 100644
--- a/string.c
+++ b/string.c
@@ -4079,6 +4079,7 @@ str_succ(VALUE str)
}
carry_pos = s - sbeg;
}
+ ENC_CODERANGE_SET(str, ENC_CODERANGE_UNKNOWN);
}
RESIZE_CAPA(str, slen + carry_len);
sbeg = RSTRING_PTR(str);
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index ec90193546..75da42eeef 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -1872,6 +1872,11 @@ CODE
assert_equal("!", " ".succ)
assert_equal("", "".succ)
+
+ bug = '[ruby-core:83062] [Bug #13952]'
+ s = "\xff".b
+ assert_not_predicate(s, :ascii_only?)
+ assert_predicate(s.succ, :ascii_only?, bug)
end
def test_succ!