mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* encoding.c (rb_enc_find_index): use original encoding name to
replicate loaded encoding instead alias. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f28118eb69
commit
9f9ac39996
2 changed files with 8 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Fri Jan 18 11:39:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* encoding.c (rb_enc_find_index): use original encoding name to
|
||||||
|
replicate loaded encoding instead alias.
|
||||||
|
|
||||||
Fri Jan 18 09:43:02 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
Fri Jan 18 09:43:02 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* re.c (rb_char_to_option_kcode): Regexp switch `s' should mean
|
* re.c (rb_char_to_option_kcode): Regexp switch `s' should mean
|
||||||
|
|
|
@ -487,14 +487,16 @@ rb_enc_find_index(const char *name)
|
||||||
if (enc_initialized_p(enc) &&
|
if (enc_initialized_p(enc) &&
|
||||||
(base = enc_base_encoding(ENC_FROM_ENCODING(enc)), !NIL_P(base))) {
|
(base = enc_base_encoding(ENC_FROM_ENCODING(enc)), !NIL_P(base))) {
|
||||||
if ((b = enc_check_encoding(base)) < 0) {
|
if ((b = enc_check_encoding(base)) < 0) {
|
||||||
|
#if 0
|
||||||
st_data_t key, val;
|
st_data_t key, val;
|
||||||
key = (st_data_t)name;
|
key = (st_data_t)name;
|
||||||
if (st_delete(enc_table.names, &key, &val)) {
|
if (st_delete(enc_table.names, &key, &val)) {
|
||||||
if (enc->name != (char *)key) xfree((char *)key);
|
if (enc->name != (char *)key) xfree((char *)key);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
enc_register_at(i, name, rb_enc_from_index(b));
|
enc_register_at(i, rb_enc_name(enc), rb_enc_from_index(b));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
i = load_encoding(rb_enc_name(enc));
|
i = load_encoding(rb_enc_name(enc));
|
||||||
|
|
Loading…
Reference in a new issue