-
-
Save headius/d8e1218229e60ec200d3fe8c9e847e96 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/ext/-test-/file/fs.c b/ext/-test-/file/fs.c | |
index c9c3473257..63d2356d76 100644 | |
--- a/ext/-test-/file/fs.c | |
+++ b/ext/-test-/file/fs.c | |
@@ -89,6 +89,9 @@ get_noatime_p(VALUE self, VALUE str) | |
rb_sys_fail_str(str); | |
} | |
# ifdef HAVE_STRUCT_STATFS_F_FLAGS | |
+# ifdef MNT_STRICTATIME | |
+ if (!(st.f_flags & MNT_STRICTATIME)) return Qtrue; | |
+# endif | |
# ifdef MNT_NOATIME | |
return st.f_flags & MNT_NOATIME ? Qtrue : Qfalse; | |
# elif defined(ST_NOATIME) | |
diff --git a/ext/fiddle/extlibs b/ext/fiddle/extlibs | |
index 290b814590..1f0c9348e6 100644 | |
--- a/ext/fiddle/extlibs | |
+++ b/ext/fiddle/extlibs | |
@@ -1,4 +1,4 @@ | |
-http://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz \ | |
+https://ftp.osuosl.org/pub/blfs/conglomeration/libffi/libffi-3.2.1.tar.gz \ | |
md5:83b89587607e3eb65c70d361f13bab43 \ | |
sha512:980ca30a8d76f963fca722432b1fe5af77d7a4e4d2eac5144fbc5374d4c596609a293440573f4294207e1bdd9fda80ad1e1cafb2ffb543df5a275bc3bd546483 \ | |
# | |
diff --git a/ext/json/parser/parser.c b/ext/json/parser/parser.c | |
index d2e4eb6686..ae90b2e8fd 100644 | |
--- a/ext/json/parser/parser.c | |
+++ b/ext/json/parser/parser.c | |
@@ -1815,7 +1815,7 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self) | |
} else { | |
json->max_nesting = 100; | |
json->allow_nan = 0; | |
- json->create_additions = 1; | |
+ json->create_additions = 0; | |
json->create_id = rb_funcall(mJSON, i_create_id, 0); | |
json->object_class = Qnil; | |
json->array_class = Qnil; | |
diff --git a/ext/json/parser/parser.rl b/ext/json/parser/parser.rl | |
index 29900a4a4a..f7dbcffb5f 100644 | |
--- a/ext/json/parser/parser.rl | |
+++ b/ext/json/parser/parser.rl | |
@@ -710,7 +710,7 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self) | |
} else { | |
json->max_nesting = 100; | |
json->allow_nan = 0; | |
- json->create_additions = 1; | |
+ json->create_additions = 0; | |
json->create_id = rb_funcall(mJSON, i_create_id, 0); | |
json->object_class = Qnil; | |
json->array_class = Qnil; | |
diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c | |
index 7b6c973803..3c048ab926 100644 | |
--- a/ext/openssl/ossl_asn1.c | |
+++ b/ext/openssl/ossl_asn1.c | |
@@ -1824,6 +1824,7 @@ do{\ | |
rb_define_method(cASN1EndOfContent, "to_der", ossl_asn1eoc_to_der, 0); | |
class_tag_map = rb_hash_new(); | |
+ rb_gc_register_mark_object(class_tag_map); | |
rb_hash_aset(class_tag_map, cASN1EndOfContent, INT2NUM(V_ASN1_EOC)); | |
rb_hash_aset(class_tag_map, cASN1Boolean, INT2NUM(V_ASN1_BOOLEAN)); | |
rb_hash_aset(class_tag_map, cASN1Integer, INT2NUM(V_ASN1_INTEGER)); | |
diff --git a/ext/ripper/lib/ripper/lexer.rb b/ext/ripper/lib/ripper/lexer.rb | |
index 9220257196..72cc9104de 100644 | |
--- a/ext/ripper/lib/ripper/lexer.rb | |
+++ b/ext/ripper/lib/ripper/lexer.rb | |
@@ -192,7 +192,7 @@ def compile(pattern) | |
if m = /[^\w\s$()\[\]{}?*+\.]/.match(pattern) | |
raise CompileError, "invalid char in pattern: #{m[0].inspect}" | |
end | |
- buf = '' | |
+ buf = +'' | |
pattern.scan(/(?:\w+|\$\(|[()\[\]\{\}?*+\.]+)/) do |tok| | |
case tok | |
when /\w/ | |
diff --git a/ext/socket/init.c b/ext/socket/init.c | |
index e357beb0c9..db51cb230e 100644 | |
--- a/ext/socket/init.c | |
+++ b/ext/socket/init.c | |
@@ -109,6 +109,7 @@ rsock_send_blocking(void *data) | |
struct recvfrom_arg { | |
int fd, flags; | |
VALUE str; | |
+ size_t length; | |
socklen_t alen; | |
union_sockaddr buf; | |
}; | |
@@ -119,10 +120,11 @@ recvfrom_blocking(void *data) | |
struct recvfrom_arg *arg = data; | |
socklen_t len0 = arg->alen; | |
ssize_t ret; | |
- ret = recvfrom(arg->fd, RSTRING_PTR(arg->str), RSTRING_LEN(arg->str), | |
+ ret = recvfrom(arg->fd, RSTRING_PTR(arg->str), arg->length, | |
arg->flags, &arg->buf.addr, &arg->alen); | |
if (ret != -1 && len0 < arg->alen) | |
arg->alen = len0; | |
+ | |
return (VALUE)ret; | |
} | |
@@ -140,7 +142,6 @@ rsock_strbuf(VALUE str, long buflen) | |
} else { | |
rb_str_modify_expand(str, buflen - len); | |
} | |
- rb_str_set_len(str, buflen); | |
return str; | |
} | |
@@ -176,6 +177,7 @@ rsock_s_recvfrom(VALUE sock, int argc, VALUE *argv, enum sock_recv_type from) | |
arg.fd = fptr->fd; | |
arg.alen = (socklen_t)sizeof(arg.buf); | |
arg.str = str; | |
+ arg.length = buflen; | |
while (rb_io_check_closed(fptr), | |
rsock_maybe_wait_fd(arg.fd), | |
@@ -186,9 +188,8 @@ rsock_s_recvfrom(VALUE sock, int argc, VALUE *argv, enum sock_recv_type from) | |
} | |
} | |
- if (slen != RSTRING_LEN(str)) { | |
- rb_str_set_len(str, slen); | |
- } | |
+ /* Resize the string to the amount of data received */ | |
+ rb_str_set_len(str, slen); | |
rb_obj_taint(str); | |
switch (from) { | |
case RECV_RECV: | |
@@ -321,6 +322,7 @@ rsock_read_nonblock(VALUE sock, VALUE length, VALUE buf, VALUE ex) | |
GetOpenFile(sock, fptr); | |
if (len == 0) { | |
+ rb_str_set_len(str, 0); | |
return str; | |
} | |
@@ -338,12 +340,9 @@ rsock_read_nonblock(VALUE sock, VALUE length, VALUE buf, VALUE ex) | |
rb_syserr_fail_path(e, fptr->pathv); | |
} | |
} | |
- if (len != n) { | |
+ if (n != RSTRING_LEN(str)) { | |
rb_str_modify(str); | |
rb_str_set_len(str, n); | |
- if (str != buf) { | |
- rb_str_resize(str, n); | |
- } | |
} | |
if (n == 0) { | |
if (ex == Qfalse) return Qnil; | |
diff --git a/gems/bundled_gems b/gems/bundled_gems | |
index c3c88f54ea..8038a60375 100644 | |
--- a/gems/bundled_gems | |
+++ b/gems/bundled_gems | |
@@ -2,6 +2,6 @@ did_you_mean 1.2.0 https://github.com/yuki24/did_you_mean | |
minitest 5.10.3 https://github.com/seattlerb/minitest | |
net-telnet 0.1.1 https://github.com/ruby/net-telnet | |
power_assert 1.1.1 https://github.com/k-tsj/power_assert | |
-rake 12.3.0 https://github.com/ruby/rake | |
+rake 12.3.3 https://github.com/ruby/rake | |
test-unit 3.2.7 https://github.com/test-unit/test-unit | |
xmlrpc 0.3.0 https://github.com/ruby/xmlrpc | |
diff --git a/marshal.c b/marshal.c | |
index 1593ca2930..d89ccf51cf 100644 | |
--- a/marshal.c | |
+++ b/marshal.c | |
@@ -553,14 +553,25 @@ w_uclass(VALUE obj, VALUE super, struct dump_arg *arg) | |
#define to_be_skipped_id(id) (id == rb_id_encoding() || id == rb_intern("E") || !rb_id2str(id)) | |
+struct w_ivar_arg { | |
+ struct dump_call_arg *dump; | |
+ st_data_t num_ivar; | |
+}; | |
+ | |
static int | |
w_obj_each(st_data_t key, st_data_t val, st_data_t a) | |
{ | |
ID id = (ID)key; | |
VALUE value = (VALUE)val; | |
- struct dump_call_arg *arg = (struct dump_call_arg *)a; | |
+ struct w_ivar_arg *ivarg = (struct w_ivar_arg *)a; | |
+ struct dump_call_arg *arg = ivarg->dump; | |
if (to_be_skipped_id(id)) return ST_CONTINUE; | |
+ if (!ivarg->num_ivar) { | |
+ rb_raise(rb_eRuntimeError, "instance variable added to %"PRIsVALUE" instance", | |
+ CLASS_OF(arg->obj)); | |
+ } | |
+ --ivarg->num_ivar; | |
w_symbol(ID2SYM(id), arg->arg); | |
w_object(value, arg->arg, arg->limit); | |
return ST_CONTINUE; | |
@@ -640,13 +651,21 @@ has_ivars(VALUE obj, VALUE encname, VALUE *ivobj) | |
return num + enc; | |
} | |
+static void | |
+w_ivar_each(VALUE obj, st_index_t num, struct dump_call_arg *arg) | |
+{ | |
+ struct w_ivar_arg ivarg = {arg, num}; | |
+ if (!num) return; | |
+ rb_ivar_foreach(obj, w_obj_each, (st_data_t)&ivarg); | |
+} | |
+ | |
static void | |
w_ivar(st_index_t num, VALUE ivobj, VALUE encname, struct dump_call_arg *arg) | |
{ | |
w_long(num, arg->arg); | |
w_encoding(encname, arg); | |
if (ivobj != Qundef) { | |
- rb_ivar_foreach(ivobj, w_obj_each, (st_data_t)arg); | |
+ w_ivar_each(ivobj, num, arg); | |
} | |
} | |
@@ -657,9 +676,7 @@ w_objivar(VALUE obj, struct dump_call_arg *arg) | |
rb_ivar_foreach(obj, obj_count_ivars, (st_data_t)&num); | |
w_long(num, arg->arg); | |
- if (num != 0) { | |
- rb_ivar_foreach(obj, w_obj_each, (st_data_t)arg); | |
- } | |
+ w_ivar_each(obj, num, arg); | |
} | |
static void | |
@@ -678,6 +695,7 @@ w_object(VALUE obj, struct dump_arg *arg, int limit) | |
if (limit > 0) limit--; | |
c_arg.limit = limit; | |
c_arg.arg = arg; | |
+ c_arg.obj = obj; | |
if (st_lookup(arg->data, obj, &num)) { | |
w_byte(TYPE_LINK, arg); | |
diff --git a/parse.y b/parse.y | |
index 8d83132e4a..383e76f991 100644 | |
--- a/parse.y | |
+++ b/parse.y | |
@@ -1511,12 +1511,10 @@ stmt : keyword_alias fitem {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);} fitem | |
command_asgn : lhs '=' command_rhs | |
{ | |
- value_expr($3); | |
$$ = node_assign($1, $3, &@$); | |
} | |
| var_lhs tOP_ASGN command_rhs | |
{ | |
- value_expr($3); | |
$$ = new_op_assign($1, $2, $3, &@$); | |
} | |
| primary_value '[' opt_call_args rbracket tOP_ASGN command_rhs | |
@@ -1524,7 +1522,6 @@ command_asgn : lhs '=' command_rhs | |
/*%%%*/ | |
NODE *args; | |
- value_expr($6); | |
$3 = make_array($3, &@3); | |
args = arg_concat($3, $6, &@$); | |
if ($5 == tOROP) { | |
@@ -1543,12 +1540,10 @@ command_asgn : lhs '=' command_rhs | |
} | |
| primary_value call_op tIDENTIFIER tOP_ASGN command_rhs | |
{ | |
- value_expr($5); | |
$$ = new_attr_op_assign($1, $2, $3, $4, $5, &@$); | |
} | |
| primary_value call_op tCONSTANT tOP_ASGN command_rhs | |
{ | |
- value_expr($5); | |
$$ = new_attr_op_assign($1, $2, $3, $4, $5, &@$); | |
} | |
| primary_value tCOLON2 tCONSTANT tOP_ASGN command_rhs | |
@@ -1564,7 +1559,6 @@ command_asgn : lhs '=' command_rhs | |
} | |
| primary_value tCOLON2 tIDENTIFIER tOP_ASGN command_rhs | |
{ | |
- value_expr($5); | |
$$ = new_attr_op_assign($1, ID2VAL(idCOLON2), $3, $4, $5, &@$); | |
} | |
| backref tOP_ASGN command_rhs | |
diff --git a/re.c b/re.c | |
index 5030519fc9..fdccea434a 100644 | |
--- a/re.c | |
+++ b/re.c | |
@@ -1883,6 +1883,7 @@ match_captures(VALUE match) | |
static int | |
name_to_backref_number(struct re_registers *regs, VALUE regexp, const char* name, const char* name_end) | |
{ | |
+ if (NIL_P(regexp)) return -1; | |
return onig_name_to_backref_number(RREGEXP_PTR(regexp), | |
(const unsigned char *)name, (const unsigned char *)name_end, regs); | |
} | |
diff --git a/string.c b/string.c | |
index ed7da23649..f0d1a286a5 100644 | |
--- a/string.c | |
+++ b/string.c | |
@@ -2043,7 +2043,7 @@ static void | |
str_make_independent_expand(VALUE str, long len, long expand, const int termlen) | |
{ | |
char *ptr; | |
- const char *oldptr; | |
+ char *oldptr; | |
long capa = len + expand; | |
if (len > capa) len = capa; | |
@@ -2062,6 +2062,9 @@ str_make_independent_expand(VALUE str, long len, long expand, const int termlen) | |
if (oldptr) { | |
memcpy(ptr, oldptr, len); | |
} | |
+ if (FL_TEST_RAW(str, STR_NOEMBED|STR_NOFREE|STR_SHARED) == STR_NOEMBED) { | |
+ xfree(oldptr); | |
+ } | |
STR_SET_NOEMBED(str); | |
FL_UNSET(str, STR_SHARED|STR_NOFREE); | |
TERM_FILL(ptr + len, termlen); | |
diff --git a/struct.c b/struct.c | |
index cf28fec6fd..16b1fe7c62 100644 | |
--- a/struct.c | |
+++ b/struct.c | |
@@ -517,7 +517,7 @@ rb_struct_define_under(VALUE outer, const char *name, ...) | |
static VALUE | |
rb_struct_s_def(int argc, VALUE *argv, VALUE klass) | |
{ | |
- VALUE name, rest, keyword_init; | |
+ VALUE name, rest, keyword_init = Qfalse; | |
long i; | |
VALUE st; | |
st_table *tbl; | |
@@ -533,18 +533,16 @@ rb_struct_s_def(int argc, VALUE *argv, VALUE klass) | |
} | |
if (RB_TYPE_P(argv[argc-1], T_HASH)) { | |
- VALUE kwargs[1]; | |
static ID keyword_ids[1]; | |
if (!keyword_ids[0]) { | |
keyword_ids[0] = rb_intern("keyword_init"); | |
} | |
- rb_get_kwargs(argv[argc-1], keyword_ids, 0, 1, kwargs); | |
+ rb_get_kwargs(argv[argc-1], keyword_ids, 0, 1, &keyword_init); | |
+ if (keyword_init == Qundef) { | |
+ keyword_init = Qfalse; | |
+ } | |
--argc; | |
- keyword_init = kwargs[0]; | |
- } | |
- else { | |
- keyword_init = Qfalse; | |
} | |
rest = rb_ident_hash_new(); | |
diff --git a/test/net/ftp/test_ftp.rb b/test/net/ftp/test_ftp.rb | |
index 8177bfe36e..8e0a688135 100644 | |
--- a/test/net/ftp/test_ftp.rb | |
+++ b/test/net/ftp/test_ftp.rb | |
@@ -377,7 +377,7 @@ def test_read_timeout_not_exceeded | |
begin | |
begin | |
ftp = Net::FTP.new | |
- ftp.read_timeout = 0.2 | |
+ ftp.read_timeout = 1.0 | |
ftp.connect(SERVER_ADDR, server.port) | |
ftp.login | |
assert_match(/\AUSER /, commands.shift) | |
@@ -386,7 +386,7 @@ def test_read_timeout_not_exceeded | |
assert_equal(nil, commands.shift) | |
ensure | |
ftp.close | |
- assert_equal(0.2, ftp.read_timeout) | |
+ assert_equal(1.0, ftp.read_timeout) | |
end | |
ensure | |
server.close | |
@@ -662,7 +662,7 @@ def test_retrbinary_read_timeout_not_exceeded | |
sock.print("150 Opening BINARY mode data connection for foo (#{binary_data.size} bytes)\r\n") | |
conn = TCPSocket.new(host, port) | |
binary_data.scan(/.{1,1024}/nm) do |s| | |
- sleep(0.1) | |
+ sleep(0.2) | |
conn.print(s) | |
end | |
conn.shutdown(Socket::SHUT_WR) | |
@@ -673,7 +673,7 @@ def test_retrbinary_read_timeout_not_exceeded | |
begin | |
begin | |
ftp = Net::FTP.new | |
- ftp.read_timeout = 0.2 | |
+ ftp.read_timeout = 1.0 | |
ftp.connect(SERVER_ADDR, server.port) | |
ftp.login | |
assert_match(/\AUSER /, commands.shift) | |
diff --git a/test/openssl/test_asn1.rb b/test/openssl/test_asn1.rb | |
index 1170703775..cc11301804 100644 | |
--- a/test/openssl/test_asn1.rb | |
+++ b/test/openssl/test_asn1.rb | |
@@ -635,6 +635,11 @@ def test_constructive_each | |
assert_equal data, seq.entries | |
end | |
+ def test_gc_stress | |
+ skip "very time consuming test" | |
+ assert_ruby_status(['--disable-gems', '-eGC.stress=true', '-erequire "openssl.so"']) | |
+ end | |
+ | |
private | |
def B(ary) | |
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb | |
index e269428dda..0565a1c04f 100644 | |
--- a/test/ruby/test_marshal.rb | |
+++ b/test/ruby/test_marshal.rb | |
@@ -779,4 +779,36 @@ def test_marshal_keyword_init_struct | |
obj = Bug14314.new(foo: 42) | |
assert_equal obj, Marshal.load(Marshal.dump(obj)) | |
end | |
+ | |
+ class Bug15968 | |
+ attr_accessor :bar, :baz | |
+ | |
+ def initialize | |
+ self.bar = Bar.new(self) | |
+ end | |
+ | |
+ class Bar | |
+ attr_accessor :foo | |
+ | |
+ def initialize(foo) | |
+ self.foo = foo | |
+ end | |
+ | |
+ def marshal_dump | |
+ self.foo.baz = :problem | |
+ {foo: self.foo} | |
+ end | |
+ | |
+ def marshal_load(data) | |
+ self.foo = data[:foo] | |
+ end | |
+ end | |
+ end | |
+ | |
+ def test_marshal_dump_adding_instance_variable | |
+ obj = Bug15968.new | |
+ assert_raise_with_message(RuntimeError, /instance variable added/) do | |
+ Marshal.dump(obj) | |
+ end | |
+ end | |
end | |
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb | |
index 15c6245bac..b725634a38 100644 | |
--- a/test/ruby/test_parse.rb | |
+++ b/test/ruby/test_parse.rb | |
@@ -1099,6 +1099,12 @@ def test_eof_in_def | |
assert_raise(SyntaxError) { eval("def m\n\C-z""end") } | |
end | |
+ def test_void_value_in_command_rhs | |
+ w = "void value expression" | |
+ ex = assert_syntax_error("x = return 1", w) | |
+ assert_equal(1, ex.message.scan(w).size, "same #{w.inspect} warning should be just once") | |
+ end | |
+ | |
=begin | |
def test_past_scope_variable | |
assert_warning(/past scope/) {catch {|tag| eval("BEGIN{throw tag}; tap {a = 1}; a")}} | |
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb | |
index a22975dbd0..fe271dc3d7 100644 | |
--- a/test/ruby/test_regexp.rb | |
+++ b/test/ruby/test_regexp.rb | |
@@ -156,6 +156,10 @@ def test_named_capture | |
s = "foo" | |
s[/(?<bar>o)/, "bar"] = "baz" | |
assert_equal("fbazo", s) | |
+ | |
+ /.*/ =~ "abc" | |
+ "a".sub("a", "") | |
+ assert_raise(IndexError) {Regexp.last_match(:_id)} | |
end | |
def test_named_capture_with_nul | |
diff --git a/test/ruby/test_struct.rb b/test/ruby/test_struct.rb | |
index 384c95f85b..af68346442 100644 | |
--- a/test/ruby/test_struct.rb | |
+++ b/test/ruby/test_struct.rb | |
@@ -92,6 +92,10 @@ def test_struct_new | |
assert_equal([:utime, :stime, :cutime, :cstime], Process.times.members) | |
end | |
+ def test_struct_new_with_empty_hash | |
+ assert_equal({:a=>1}, Struct.new(:a, {}).new({:a=>1}).a) | |
+ end | |
+ | |
def test_struct_new_with_keyword_init | |
@Struct.new("KeywordInitTrue", :a, :b, keyword_init: true) | |
@Struct.new("KeywordInitFalse", :a, :b, keyword_init: false) | |
diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb | |
index 8be7294440..bfe9b4eef3 100644 | |
--- a/test/ruby/test_time_tz.rb | |
+++ b/test/ruby/test_time_tz.rb | |
@@ -155,6 +155,12 @@ def test_asia_tokyo | |
} | |
end | |
+ def test_asia_kuala_lumpur | |
+ with_tz(tz="Asia/Kuala_Lumpur") { | |
+ assert_time_constructor(tz, "1933-01-01 00:20:00 +0720", :local, [1933]) | |
+ } | |
+ end | |
+ | |
def test_canada_newfoundland | |
with_tz(tz="America/St_Johns") { | |
assert_time_constructor(tz, "2007-11-03 23:00:59 -0230", :new, [2007,11,3,23,0,59,:dst]) | |
diff --git a/test/test_rbconfig.rb b/test/test_rbconfig.rb | |
index 1bbf01b9a6..fcbbbd8500 100644 | |
--- a/test/test_rbconfig.rb | |
+++ b/test/test_rbconfig.rb | |
@@ -51,4 +51,13 @@ def test_vendorarchdirs | |
assert_match(/\$\(sitearch|\$\(rubysitearchprefix\)/, val, "#{key} #{bug7823}") | |
end | |
end | |
+ | |
+ if /darwin/ =~ RUBY_PLATFORM | |
+ def test_sdkroot | |
+ assert_separately([{"SDKROOT" => "$(prefix)/SDKRoot"}], "#{<<~"begin;"}\n#{<<~'end;'}") | |
+ begin; | |
+ assert_equal RbConfig::CONFIG["prefix"]+"/SDKRoot", RbConfig::CONFIG["SDKROOT"] | |
+ end; | |
+ end | |
+ end | |
end | |
diff --git a/time.c b/time.c | |
index 1967c5d689..0470775024 100644 | |
--- a/time.c | |
+++ b/time.c | |
@@ -2958,12 +2958,12 @@ find_time_t(struct tm *tptr, int utc_p, time_t *tp) | |
*tp = guess_lo + | |
((tptr->tm_year - tm_lo.tm_year) * 365 + | |
- ((tptr->tm_year-69)/4) - | |
- ((tptr->tm_year-1)/100) + | |
- ((tptr->tm_year+299)/400) - | |
- ((tm_lo.tm_year-69)/4) + | |
- ((tm_lo.tm_year-1)/100) - | |
- ((tm_lo.tm_year+299)/400) + | |
+ DIV((tptr->tm_year-69), 4) - | |
+ DIV((tptr->tm_year-1), 100) + | |
+ DIV((tptr->tm_year+299), 400) - | |
+ DIV((tm_lo.tm_year-69), 4) + | |
+ DIV((tm_lo.tm_year-1), 100) - | |
+ DIV((tm_lo.tm_year+299), 400) + | |
tptr_tm_yday - | |
tm_lo.tm_yday) * 86400 + | |
(tptr->tm_hour - tm_lo.tm_hour) * 3600 + | |
diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb | |
index d6c86b4803..52ec6a85d7 100755 | |
--- a/tool/mkconfig.rb | |
+++ b/tool/mkconfig.rb | |
@@ -245,7 +245,7 @@ module RbConfig | |
CONFIG["UNICODE_VERSION"] = #{$unicode_version.dump} | |
EOS | |
print <<EOS if /darwin/ =~ arch | |
- CONFIG["SDKROOT"] = ENV["SDKROOT"] || "" # don't run xcrun everytime, usually useless. | |
+ CONFIG["SDKROOT"] = "\#{ENV['SDKROOT']}" # don't run xcrun every time, usually useless. | |
EOS | |
print <<EOS | |
CONFIG["archdir"] = "$(rubyarchdir)" | |
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb | |
index 830ce97df7..d0bb30918e 100755 | |
--- a/tool/rbinstall.rb | |
+++ b/tool/rbinstall.rb | |
@@ -327,10 +327,14 @@ def CONFIG.[](name, mandatory = false) | |
archhdrdir = CONFIG["rubyarchhdrdir"] || (rubyhdrdir + "/" + CONFIG['arch']) | |
rubylibdir = CONFIG["rubylibdir", true] | |
archlibdir = CONFIG["rubyarchdir", true] | |
-sitelibdir = CONFIG["sitelibdir"] | |
-sitearchlibdir = CONFIG["sitearchdir"] | |
-vendorlibdir = CONFIG["vendorlibdir"] | |
-vendorarchlibdir = CONFIG["vendorarchdir"] | |
+if CONFIG["sitedir"] | |
+ sitelibdir = CONFIG["sitelibdir"] | |
+ sitearchlibdir = CONFIG["sitearchdir"] | |
+end | |
+if CONFIG["vendordir"] | |
+ vendorlibdir = CONFIG["vendorlibdir"] | |
+ vendorarchlibdir = CONFIG["vendorarchdir"] | |
+end | |
mandir = CONFIG["mandir", true] | |
docdir = CONFIG["docdir", true] | |
configure_args = Shellwords.shellwords(CONFIG["configure_args"]) | |
diff --git a/version.h b/version.h | |
index 1964acaab0..4bae205bb7 100644 | |
--- a/version.h | |
+++ b/version.h | |
@@ -1,10 +1,10 @@ | |
-#define RUBY_VERSION "2.5.7" | |
-#define RUBY_RELEASE_DATE "2019-10-01" | |
-#define RUBY_PATCHLEVEL 206 | |
+#define RUBY_VERSION "2.5.8" | |
+#define RUBY_RELEASE_DATE "2020-03-31" | |
+#define RUBY_PATCHLEVEL 224 | |
-#define RUBY_RELEASE_YEAR 2019 | |
-#define RUBY_RELEASE_MONTH 10 | |
-#define RUBY_RELEASE_DAY 1 | |
+#define RUBY_RELEASE_YEAR 2020 | |
+#define RUBY_RELEASE_MONTH 3 | |
+#define RUBY_RELEASE_DAY 31 | |
#include "ruby/version.h" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment