diff options
author | S-H-GAMELINKS <[email protected]> | 2022-11-15 13:21:45 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2022-12-02 01:31:27 +0900 |
commit | 1a64d45c67feed7355d6b53746801acb319394a4 (patch) | |
tree | 7de928b38b2fc079d91120f22d89b92ca6a3e110 /re.c | |
parent | 7bc63d6f430422535f4dd460a98f3a90578e524c (diff) |
Introduce encoding check macro
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6700
Diffstat (limited to 're.c')
-rw-r--r-- | re.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -16,6 +16,7 @@ #include "encindex.h" #include "hrtime.h" #include "internal.h" +#include "internal/encoding.h" #include "internal/hash.h" #include "internal/imemo.h" #include "internal/re.h" @@ -2866,7 +2867,7 @@ unescape_nonascii(const char *p, const char *end, rb_encoding *enc, case 'C': /* \C-X, \C-\M-X */ case 'M': /* \M-X, \M-\C-X, \M-\cX */ p = p-2; - if (enc == rb_usascii_encoding()) { + if (rb_is_usascii_enc(enc)) { const char *pbeg = p; int byte = read_escaped_byte(&p, end, err); if (byte == -1) return -1; |