diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-15 00:34:16 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-15 00:34:16 +0000 |
commit | 96ae1f008fa0072730aee64dd8d2cc30badfe69d (patch) | |
tree | a0b3df69d39570070e5aea53ec65a28f349ff885 | |
parent | 8b04d998ae83ffaf59296b28ac3df65fb7c73477 (diff) | |
download | ruby-96ae1f008fa0072730aee64dd8d2cc30badfe69d.tar.gz |
* transcode.c (conv_init): check empty name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | transcode.c | 10 |
2 files changed, 10 insertions, 4 deletions
@@ -1,3 +1,7 @@ +Fri Aug 15 09:33:48 2008 Tanaka Akira <akr@fsij.org> + + * transcode.c (conv_init): check empty name. + Fri Aug 15 09:03:54 2008 Tanaka Akira <akr@fsij.org> * transcode.c (econv_init): don't create dummy encoding if diff --git a/transcode.c b/transcode.c index b7f222ad74..16979b9b4b 100644 --- a/transcode.c +++ b/transcode.c @@ -1497,10 +1497,12 @@ econv_init(int argc, VALUE *argv, VALUE self) rb_raise(rb_eArgError, "encoding convewrter not supported (from %s to %s)", sname, dname); } - if (!senc) - senc = make_dummy_encoding(sname); - if (!denc) - denc = make_dummy_encoding(dname); + if (*sname && *dname) { /* check "" to "universal_newline" */ + if (!senc) + senc = make_dummy_encoding(sname); + if (!denc) + denc = make_dummy_encoding(dname); + } ec->source_encoding = senc; ec->destination_encoding = denc; |