aboutsummaryrefslogtreecommitdiffstats
path: root/re.c
diff options
context:
space:
mode:
Diffstat (limited to 're.c')
-rw-r--r--re.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/re.c b/re.c
index 7c925c6ba7..bceec15f0a 100644
--- a/re.c
+++ b/re.c
@@ -340,8 +340,7 @@ rb_reg_expr_str(VALUE str, const char *s, long len,
p = s; pend = p + len;
rb_str_coderange_scan_restartable(p, pend, enc, &cr);
- if (rb_enc_asciicompat(enc) &&
- (cr == ENC_CODERANGE_VALID || cr == ENC_CODERANGE_7BIT)) {
+ if (rb_enc_asciicompat(enc) && ENC_CODERANGE_CLEAN_P(cr)) {
while (p < pend) {
c = rb_enc_ascget(p, pend, &clen, enc);
if (c == -1) {