summaryrefslogtreecommitdiff
path: root/transcode.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-03 03:25:21 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-03 03:25:21 (GMT)
commite0ec0c7dc4c7ad50d54a05ccb471caa791b9d445 (patch)
treeb73080d7ea01f8d6b9947d980f586a738404e47b /transcode.c
parentb2a36083f8c3a5f7ec142ce3d9d8990788a162a6 (diff)
transcode.c: empty encoding name
* transcode.c (rb_econv_set_replacement): target encoding name can be empty now. [ruby-core:69841] [Bug #11324] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'transcode.c')
-rw-r--r--transcode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/transcode.c b/transcode.c
index b9d0adc..5e20fd7 100644
--- a/transcode.c
+++ b/transcode.c
@@ -2199,7 +2199,7 @@ rb_econv_set_replacement(rb_econv_t *ec,
encname2 = rb_econv_encoding_to_insert_output(ec);
- if (encoding_equal(encname, encname2)) {
+ if (!*encname2 || encoding_equal(encname, encname2)) {
str2 = xmalloc(len);
MEMCPY(str2, str, unsigned char, len); /* xxx: str may be invalid */
len2 = len;