summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-15 07:59:33 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-15 07:59:33 +0000
commit9eab65b3f088d8109cdc27888afcb763e5d5181c (patch)
treeb69c767b86c6b53f60cb40af9a994749323c9732 /ruby.c
parent9615084012e52961ce7648b7736f86f4eb8ebe48 (diff)
* ruby.c (proc_options): encoding libraries cannot be loaded until
load path is set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/ruby.c b/ruby.c
index 20a2a9083c..356bd4eed7 100644
--- a/ruby.c
+++ b/ruby.c
@@ -707,24 +707,23 @@ proc_options(int argc, char **argv, struct cmdline_options *opt)
case 'K':
if (*++s) {
- rb_encoding *enc = 0;
+ const char *enc_name = 0;
switch (*s) {
case 'E': case 'e':
- enc = rb_enc_find("EUC-JP");
+ enc_name = "EUC-JP";
break;
case 'S': case 's':
- enc = rb_enc_find("Windows-31J");
- if (!enc) enc = rb_enc_find("Shift_JIS");
+ enc_name = "Windows-31J";
break;
case 'U': case 'u':
- enc = ONIG_ENCODING_UTF8;
+ enc_name = "UTF-8";
break;
case 'N': case 'n': case 'A': case 'a':
- enc = ONIG_ENCODING_ASCII;
+ enc_name = "US-ASCII";
break;
}
- if (enc) {
- opt->enc_name = rb_str_new2(rb_enc_name(enc));
+ if (enc_name) {
+ opt->enc_name = rb_str_new2(enc_name);
}
s++;
}