date_parse.c: name JISX0301_DEFAULT_ERA

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2019-04-02 04:36:34 +00:00
parent da0fceae3b
commit 7cd6706b9a

View File

@ -1213,6 +1213,7 @@ parse_iso2(VALUE str, VALUE hash)
}
#define JISX0301_ERA_INITIALS "mtsh"
#define JISX0301_DEFAULT_ERA 'H' /* obsolete */
static int
gengo(int c)
@ -2953,7 +2954,7 @@ jisx0301_cb(VALUE m, VALUE hash)
s[i] = rb_reg_nth_match(i, m);
}
ep = gengo(NIL_P(s[1]) ? 'h' : *RSTRING_PTR(s[1]));
ep = gengo(NIL_P(s[1]) ? JISX0301_DEFAULT_ERA : *RSTRING_PTR(s[1]));
set_hash("year", f_add(str2num(s[2]), INT2FIX(ep)));
set_hash("mon", str2num(s[3]));
set_hash("mday", str2num(s[4]));