diff options
author | Nobuyoshi Nakada <[email protected]> | 2021-02-16 19:36:20 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2021-02-16 20:34:23 +0900 |
commit | 296a2cab07ce530809ee74dee61180fbb3ca6f91 (patch) | |
tree | 4404f56f04e82c8ef31f39f25ad35e377b4864ba /time.c | |
parent | 5b7439bb7b1088ef5233175893229970cee339fd (diff) |
Parse "-00:00" as UTC for the round-trip [Feature #17544]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4075
Diffstat (limited to 'time.c')
-rw-r--r-- | time.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -2150,8 +2150,10 @@ utc_offset_arg(VALUE arg) if (s[0] != '+' && s[0] != '-') goto invalid_utc_offset; if (!ISDIGIT(s[1]) || !ISDIGIT(s[2])) goto invalid_utc_offset; n += (s[1] * 10 + s[2] - '0' * 11) * 3600; - if (s[0] == '-') + if (s[0] == '-') { + if (n == 0) return UTC_ZONE; n = -n; + } return INT2FIX(n); } else { |