diff options
author | Jean Boussier <[email protected]> | 2022-07-13 11:54:08 +0200 |
---|---|---|
committer | Jean Boussier <[email protected]> | 2022-07-19 08:48:56 +0200 |
commit | d084585f01b57727a5778f2f6723b89c6d98a9d4 (patch) | |
tree | 8358220e50e538c08a89f69544ae0fae0918bee2 /file.c | |
parent | 85ea46730deff70172a9f50172f0011a7401f371 (diff) |
Rename ENCINDEX_ASCII to ENCINDEX_ASCII_8BIT
Otherwise it's way too easy to confuse it with US_ASCII.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6127
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -182,7 +182,7 @@ file_path_convert(VALUE name) int fname_encidx = ENCODING_GET(name); int fs_encidx; if (ENCINDEX_US_ASCII != fname_encidx && - ENCINDEX_ASCII != fname_encidx && + ENCINDEX_ASCII_8BIT != fname_encidx && (fs_encidx = rb_filesystem_encindex()) != fname_encidx && rb_default_internal_encoding() && !rb_enc_str_asciionly_p(name)) { @@ -253,11 +253,11 @@ rb_str_encode_ospath(VALUE path) #if USE_OSPATH int encidx = ENCODING_GET(path); #if 0 && defined _WIN32 - if (encidx == ENCINDEX_ASCII) { + if (encidx == ENCINDEX_ASCII_8BIT) { encidx = rb_filesystem_encindex(); } #endif - if (encidx != ENCINDEX_ASCII && encidx != ENCINDEX_UTF_8) { + if (encidx != ENCINDEX_ASCII_8BIT && encidx != ENCINDEX_UTF_8) { rb_encoding *enc = rb_enc_from_index(encidx); rb_encoding *utf8 = rb_utf8_encoding(); path = rb_str_conv_enc(path, enc, utf8); @@ -4396,7 +4396,7 @@ rb_check_realpath_emulate(VALUE basedir, VALUE path, rb_encoding *origenc, enum #endif switch (rb_enc_to_index(enc)) { - case ENCINDEX_ASCII: + case ENCINDEX_ASCII_8BIT: case ENCINDEX_US_ASCII: rb_enc_associate_index(resolved, rb_filesystem_encindex()); } @@ -6425,7 +6425,7 @@ static VALUE copy_path_class(VALUE path, VALUE orig) { int encidx = rb_enc_get_index(orig); - if (encidx == ENCINDEX_ASCII || encidx == ENCINDEX_US_ASCII) + if (encidx == ENCINDEX_ASCII_8BIT || encidx == ENCINDEX_US_ASCII) encidx = rb_filesystem_encindex(); rb_enc_associate_index(path, encidx); str_shrink(path); |