summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-31 16:04:11 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-31 16:04:11 +0000
commitd64a9753968e793e23f03c6b5de31d300e4bd438 (patch)
tree6fa226540c93aa0199ebb8c6bc79abf9690333d1 /ruby.c
parent6cb161a66c014db83c62ebf8a0d6beff60f44382 (diff)
* ruby.c (process_options): rejects dummy encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ruby.c b/ruby.c
index a47403eb55..bc0fdde4e1 100644
--- a/ruby.c
+++ b/ruby.c
@@ -969,6 +969,9 @@ process_options(VALUE arg)
if ((opt->enc_index = rb_enc_find_index(s)) < 0) {
rb_raise(rb_eRuntimeError, "unknown encoding name - %s", s);
}
+ else if (rb_enc_dummy_p(rb_enc_from_index(opt->enc_index))) {
+ rb_raise(rb_eRuntimeError, "dummy encoding is not acceptable - %s ", s);
+ }
}
if (opt->e_script) {
if (opt->enc_index >= 0)