summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
-rw-r--r--time.c12
1 files changed, 3 insertions, 9 deletions
@@ -2789,9 +2789,10 @@ month_arg(VALUE arg)
return obj2ubits(arg, 4);
}
VALUE s = rb_check_string_type(arg);
if (!NIL_P(s) && RSTRING_LEN(s) > 0) {
- mon = 0;
for (i=0; i<12; i++) {
if (RSTRING_LEN(s) == 3 &&
STRNCASECMP(months[i], RSTRING_PTR(s), 3) == 0) {
@@ -2799,15 +2800,8 @@ month_arg(VALUE arg)
break;
}
}
- if (mon == 0) {
- char c = RSTRING_PTR(s)[0];
-
- if ('0' <= c && c <= '9') {
- mon = obj2ubits(s, 4);
- }
- }
}
- else {
mon = obj2ubits(arg, 4);
}
return mon;