mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* transcode.c (enc_arg): default interanl encoding may not be set.
[ruby-core:23932] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
29313aa320
commit
3448160b24
2 changed files with 7 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
Sun Jun 21 10:46:32 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* transcode.c (enc_arg): default interanl encoding may not be set.
|
||||
[ruby-core:23932]
|
||||
|
||||
Sat Jun 20 21:11:43 2009 Tadayoshi Funaba <tadf@dotrb.org>
|
||||
|
||||
* numeric.c (num_div): don't use num_floor which is actually
|
||||
|
|
|
@ -2470,13 +2470,13 @@ enc_arg(volatile VALUE *arg, const char **name_p, rb_encoding **enc_p)
|
|||
int encidx;
|
||||
VALUE encval;
|
||||
|
||||
if ((encidx = rb_to_encoding_index(encval = *arg)) < 0) {
|
||||
if (((encidx = rb_to_encoding_index(encval = *arg)) < 0) ||
|
||||
!(enc = rb_enc_from_index(encidx))) {
|
||||
enc = NULL;
|
||||
encidx = 0;
|
||||
n = StringValueCStr(*arg);
|
||||
}
|
||||
else {
|
||||
enc = rb_enc_from_index(encidx);
|
||||
n = rb_enc_name(enc);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue