summaryrefslogtreecommitdiffstats
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-13 04:53:02 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-13 04:53:02 +0000
commit2b5cf7fb6e265fcd326aa6bcb1869086add41a5d (patch)
tree5d45ccca2222ca49f2989b569ad90594018eaa27 /ruby.c
parent1be3a4d588faa3900003b78a50e978630ad791e6 (diff)
downloadruby-2b5cf7fb6e265fcd326aa6bcb1869086add41a5d.tar.gz
ruby-2b5cf7fb6e265fcd326aa6bcb1869086add41a5d.tar.xz
ruby-2b5cf7fb6e265fcd326aa6bcb1869086add41a5d.zip
* ruby.c (load_file): local variable was not initialized when -x flag
is given. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ruby.c b/ruby.c
index e3b700bdc..7feef787f 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1064,6 +1064,7 @@ load_file(VALUE parser, const char *fname, int script, struct cmdline_options *o
VALUE c = 1; /* something not nil */
VALUE line;
char *p;
+ int no_enc = !opt->enc_name;
if (opt->xflag) {
forbid_setid("-x");
@@ -1083,8 +1084,6 @@ load_file(VALUE parser, const char *fname, int script, struct cmdline_options *o
c = rb_io_getbyte(f);
if (c == INT2FIX('#')) {
- int no_enc = !opt->enc_name;
-
c = rb_io_getbyte(f);
if (c == INT2FIX('!')) {
line = rb_io_gets(f);