summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2022-07-13 11:54:08 +0200
committerJean Boussier <jean.boussier@gmail.com>2022-07-19 08:48:56 +0200
commitd084585f01b57727a5778f2f6723b89c6d98a9d4 (patch)
tree8358220e50e538c08a89f69544ae0fae0918bee2 /string.c
parent85ea46730deff70172a9f50172f0011a7401f371 (diff)
downloadruby-d084585f01b57727a5778f2f6723b89c6d98a9d4.tar.gz
Rename ENCINDEX_ASCII to ENCINDEX_ASCII_8BIT
Otherwise it's way too easy to confuse it with US_ASCII.
Diffstat (limited to 'string.c')
-rw-r--r--string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/string.c b/string.c
index acac93f7df..4cca9b1eac 100644
--- a/string.c
+++ b/string.c
@@ -3441,7 +3441,7 @@ rb_str_concat(VALUE str1, VALUE str2)
}
encidx = rb_enc_to_index(enc);
- if (encidx == ENCINDEX_ASCII || encidx == ENCINDEX_US_ASCII) {
+ if (encidx == ENCINDEX_ASCII_8BIT || encidx == ENCINDEX_US_ASCII) {
/* US-ASCII automatically extended to ASCII-8BIT */
char buf[1];
buf[0] = (char)code;
@@ -3450,7 +3450,7 @@ rb_str_concat(VALUE str1, VALUE str2)
}
rb_str_cat(str1, buf, 1);
if (encidx == ENCINDEX_US_ASCII && code > 127) {
- rb_enc_associate_index(str1, ENCINDEX_ASCII);
+ rb_enc_associate_index(str1, ENCINDEX_ASCII_8BIT);
ENC_CODERANGE_SET(str1, ENC_CODERANGE_VALID);
}
}