Fix messages for too small year

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-09-27 10:22:08 +00:00
Родитель ce77c3859a
Коммит 0e3e0f8249
1 изменённых файлов: 4 добавлений и 2 удалений

6
time.c
Просмотреть файл

@ -4579,10 +4579,12 @@ time_mdump(VALUE time)
if (FIXNUM_P(vtm.year)) {
year = FIX2LONG(vtm.year);
if (year < 1900 || 1900+0xffff < year)
rb_raise(rb_eArgError, "year too big to marshal: %ld UTC", year);
rb_raise(rb_eArgError, "year too %s to marshal: %ld UTC",
(year < 1900 ? "small" : "big"), year);
}
else {
rb_raise(rb_eArgError, "year too big to marshal");
rb_raise(rb_eArgError, "year too %s to marshal: %"PRIsVALUE" UTC",
(le(vtm.year, INT2FIX(1900)) ? "small" : "big"), vtm.year);
}
subsecx = vtm.subsecx;