* ruby.c (process_sflag, proc_options, load_file_internal): fixed

types.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-09-13 11:18:51 +00:00
parent 1c75c0e28c
commit a39f4e5cf6
2 changed files with 14 additions and 9 deletions

View File

@ -1,3 +1,8 @@
Sun Sep 13 20:18:49 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ruby.c (process_sflag, proc_options, load_file_internal): fixed
types.
Sun Sep 13 19:39:59 2009 Masaki Suketa <masaki.suketa@nifty.ne.jp> Sun Sep 13 19:39:59 2009 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole.c: some refactoring. * ext/win32ole/win32ole.c: some refactoring.

18
ruby.c
View File

@ -497,7 +497,7 @@ process_sflag(int *sflag)
VALUE v = *args++; VALUE v = *args++;
char *s = StringValuePtr(v); char *s = StringValuePtr(v);
char *p; char *p;
int hyphen = Qfalse; int hyphen = FALSE;
if (s[0] != '-') if (s[0] != '-')
break; break;
@ -514,7 +514,7 @@ process_sflag(int *sflag)
break; break;
} }
if (*p == '-') { if (*p == '-') {
hyphen = Qtrue; hyphen = TRUE;
} }
else if (*p != '_' && !ISALNUM(*p)) { else if (*p != '_' && !ISALNUM(*p)) {
VALUE name_error[2]; VALUE name_error[2];
@ -695,17 +695,17 @@ proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt)
switch (*s) { switch (*s) {
case 'a': case 'a':
if (envopt) goto noenvopt; if (envopt) goto noenvopt;
opt->do_split = Qtrue; opt->do_split = TRUE;
s++; s++;
goto reswitch; goto reswitch;
case 'p': case 'p':
if (envopt) goto noenvopt; if (envopt) goto noenvopt;
opt->do_print = Qtrue; opt->do_print = TRUE;
/* through */ /* through */
case 'n': case 'n':
if (envopt) goto noenvopt; if (envopt) goto noenvopt;
opt->do_loop = Qtrue; opt->do_loop = TRUE;
s++; s++;
goto reswitch; goto reswitch;
@ -778,7 +778,7 @@ proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt)
case 'l': case 'l':
if (envopt) goto noenvopt; if (envopt) goto noenvopt;
opt->do_line = Qtrue; opt->do_line = TRUE;
rb_output_rs = rb_rs; rb_output_rs = rb_rs;
s++; s++;
goto reswitch; goto reswitch;
@ -786,7 +786,7 @@ proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt)
case 'S': case 'S':
if (envopt) goto noenvopt; if (envopt) goto noenvopt;
forbid_setid("-S"); forbid_setid("-S");
opt->do_search = Qtrue; opt->do_search = TRUE;
s++; s++;
goto reswitch; goto reswitch;
@ -828,7 +828,7 @@ proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt)
case 'x': case 'x':
if (envopt) goto noenvopt; if (envopt) goto noenvopt;
opt->xflag = Qtrue; opt->xflag = TRUE;
s++; s++;
if (*s && chdir(s) < 0) { if (*s && chdir(s) < 0) {
rb_fatal("Can't chdir to %s", s); rb_fatal("Can't chdir to %s", s);
@ -1513,7 +1513,7 @@ load_file_internal(VALUE arg)
if (opt->xflag) { if (opt->xflag) {
search_shebang: search_shebang:
forbid_setid("-x"); forbid_setid("-x");
opt->xflag = Qfalse; opt->xflag = FALSE;
while (!NIL_P(line = rb_io_gets(f))) { while (!NIL_P(line = rb_io_gets(f))) {
line_start++; line_start++;
if (RSTRING_LEN(line) > 2 if (RSTRING_LEN(line) > 2