diff --git a/Rakefile b/Rakefile index a5aa36798b..3fdfc28ad3 100644 --- a/Rakefile +++ b/Rakefile @@ -46,8 +46,9 @@ end desc "Run test" task :test do + require 'shellwords' ENV["RUBYOPT"] = "-I#{extra_require_path} -rbundler/setup" - ruby("run-test.rb") + ruby("run-test.rb", *ENV["TESTOPTS"]&.shellsplit) end desc "Run benchmark" diff --git a/ext/strscan/strscan.c b/ext/strscan/strscan.c index 39178c6259..93ba9da955 100644 --- a/ext/strscan/strscan.c +++ b/ext/strscan/strscan.c @@ -1274,7 +1274,7 @@ static VALUE strscan_scan_base10_integer(VALUE self) { char *ptr; - long len = 0; + long len = 0, remaining_len; struct strscanner *p; GET_SCANNER(self, p); @@ -1284,7 +1284,7 @@ strscan_scan_base10_integer(VALUE self) ptr = CURPTR(p); - long remaining_len = S_RESTLEN(p); + remaining_len = S_RESTLEN(p); if (remaining_len <= 0) { return Qnil; @@ -1311,7 +1311,7 @@ static VALUE strscan_scan_base16_integer(VALUE self) { char *ptr; - long len = 0; + long len = 0, remaining_len; struct strscanner *p; GET_SCANNER(self, p); @@ -1321,7 +1321,7 @@ strscan_scan_base16_integer(VALUE self) ptr = CURPTR(p); - long remaining_len = S_RESTLEN(p); + remaining_len = S_RESTLEN(p); if (remaining_len <= 0) { return Qnil;