summaryrefslogtreecommitdiff
path: root/ext/nkf
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-07 00:06:55 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-07 00:06:55 +0000
commit5a8d5c873bc2616d1646d3708e6f5f0855129353 (patch)
treec95172517d9212d0cdae62c2f48cb057b8b92bbe /ext/nkf
parent4f0083e45fe977d0c8e728ed39a746161bb3abba (diff)
* ext/nkf/nkf-utf8/nkf.c (nkf_enc_from_index): BINARY does not
have in-bound encoding index. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/nkf')
-rw-r--r--ext/nkf/nkf-utf8/nkf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/nkf/nkf-utf8/nkf.c b/ext/nkf/nkf-utf8/nkf.c
index 9bf96fd..a711938 100644
--- a/ext/nkf/nkf-utf8/nkf.c
+++ b/ext/nkf/nkf-utf8/nkf.c
@@ -674,6 +674,8 @@ static void nkf_str_upcase(const char *src, char *dest, size_t length)
static nkf_encoding *nkf_enc_from_index(int idx)
{
if (idx < 0 || NKF_ENCODING_TABLE_SIZE <= idx) {
+ if (idx == BINARY)
+ return &nkf_encoding_table[NKF_ENCODING_TABLE_SIZE];
return 0;
}
return &nkf_encoding_table[idx];