From 96ae1f008fa0072730aee64dd8d2cc30badfe69d Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 15 Aug 2008 00:34:16 +0000 Subject: [PATCH] * transcode.c (conv_init): check empty name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ transcode.c | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index fd0205713d..995c39f1ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Fri Aug 15 09:33:48 2008 Tanaka Akira + + * transcode.c (conv_init): check empty name. + Fri Aug 15 09:03:54 2008 Tanaka Akira * 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;