From 73bf4c2af56d827a57acfe1f13de1c30119fa510 Mon Sep 17 00:00:00 2001 From: akr Date: Tue, 9 Sep 2008 16:06:54 +0000 Subject: * enc/trans/newline.trans (rb_universal_newline): swap src_encoding and dst_encoding. * transcode.c (rb_econv_decorate_at): call get_transcoder_entry only once. (rb_econv_binmode): follow universal_newline change. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- transcode.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'transcode.c') diff --git a/transcode.c b/transcode.c index 0fbbd0a11..0ca20d239 100644 --- a/transcode.c +++ b/transcode.c @@ -132,7 +132,7 @@ struct rb_econv_t { * Dispatch data and logic */ -#define SUPPLEMENTAL_CONVERSION(sname, dname) (*(sname) == '\0' || *(dname) == '\0') +#define SUPPLEMENTAL_CONVERSION(sname, dname) (*(sname) == '\0') typedef struct { const char *sname; @@ -1761,8 +1761,6 @@ rb_econv_decorate_at(rb_econv_t *ec, const char *decorator_name, int n) return -1; entry = get_transcoder_entry("", decorator_name); - if (!entry) - entry = get_transcoder_entry(decorator_name, ""); if (!entry) return -1; @@ -1833,7 +1831,7 @@ rb_econv_binmode(rb_econv_t *ec) n = 0; if (ec->flags & ECONV_UNIVERSAL_NEWLINE_DECORATOR) { - entry = get_transcoder_entry("universal_newline", ""); + entry = get_transcoder_entry("", "universal_newline"); if (entry->transcoder) trs[n++] = entry->transcoder; } -- cgit