summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-29 12:23:04 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-29 12:23:04 +0000
commit290deeb7052f54b2bf7adb520c0601b578524580 (patch)
treebd6601cf3d21ddd91ae900f627ae09fa7a653126 /ruby.c
parent3d458cd051c29e7644812fb13db7c3c6812edae8 (diff)
ruby.c: overriding warning options
* ruby.c (proc_options): successive -W option overrides previous warning options. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ruby.c b/ruby.c
index 2e586c4..0a39bfb 100644
--- a/ruby.c
+++ b/ruby.c
@@ -832,6 +832,7 @@ proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt)
{
long n, argc0 = argc;
const char *s;
+ int warning = opt->warning;
if (argc == 0)
return 0;
@@ -881,7 +882,7 @@ proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt)
opt->verbose = 1;
case 'w':
if (!opt->warning) {
- opt->warning = 1;
+ warning = 1;
ruby_verbose = Qtrue;
}
s++;
@@ -911,7 +912,7 @@ proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt)
break;
}
}
- opt->warning = 1;
+ warning = 1;
}
goto reswitch;
@@ -1234,6 +1235,7 @@ proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt)
}
switch_end:
+ if (warning) opt->warning = warning;
return argc0 - argc;
}