summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-08-21 17:29:44 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-09-25 22:57:28 +0900
commitf714448be7613017779d196daa72238b0efffaba (patch)
treeecf21280634c787c110e7d143d67cff3c3039af8 /ruby.c
parent70e8a08295114fa3cb112ddb42844889f7f98eb1 (diff)
Honor the same option given later
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ruby.c b/ruby.c
index 125bfb9453..0276fbcde9 100644
--- a/ruby.c
+++ b/ruby.c
@@ -899,6 +899,7 @@ moreswitches(const char *s, ruby_cmdline_options_t *opt, int envopt)
ruby_features_t feat = opt->features;
ruby_features_t warn = opt->warn;
long backtrace_length_limit = opt->backtrace_length_limit;
+ const char *bugreport_path = opt->bugreport_path;
while (ISSPACE(*s)) s++;
if (!*s) return;
@@ -953,6 +954,9 @@ moreswitches(const char *s, ruby_cmdline_options_t *opt, int envopt)
if (BACKTRACE_LENGTH_LIMIT_VALID_P(backtrace_length_limit)) {
opt->backtrace_length_limit = backtrace_length_limit;
}
+ if (bugreport_path) {
+ opt->bugreport_path = bugreport_path;
+ }
ruby_xfree(ptr);
/* get rid of GC */
@@ -1464,9 +1468,7 @@ proc_long_options(ruby_cmdline_options_t *opt, const char *s, long argc, char **
}
}
else if (is_option_with_arg("bugreport-path", true, true)) {
- if (!opt->bugreport_path) {
- opt->bugreport_path = s;
- }
+ opt->bugreport_path = s;
}
else {
rb_raise(rb_eRuntimeError,