+2015-08-28 James Perkins <james@loowit.net>
+
+ [BZ #16141]
+ * time/strptime_l.c (__strptime_internal): Fix %z minutes
+ calculation, removing incorrect decimal time rounding, so that
+ all minute values result in a valid seconds value.
+ * time/strptime_l.c (__strptime_internal): Extend %z time zone
+ offset range limits to UTC-99:59 through UTC+99:59 to parse
+ current and historical use cases.
+ * time/tst-strptime2.c (tests): Modify and add tests for the
+ strptime %z input field descriptor, specifically conversion of
+ minutes to seconds and validating an offset range of -9959 to
+ +9959.
+
2015-08-27 Adhemerval Zanella <adhemerval.zanella@linaro.org>
Dmitry V. Levin <ldv@altlinux.org>
* The following bugs are resolved with this release:
- 2898, 14341, 15786, 16517, 16519, 16520, 16734, 16973, 17787, 17905,
- 18084, 18086, 18240, 18265, 18370, 18421, 18480, 18525, 18610, 18618,
- 18647, 18661, 18674, 18681, 18778, 18781, 18787, 18789, 18790, 18795,
- 18796, 18820, 18823, 18824, 18863.
+ 2898, 14341, 15786, 16141, 16517, 16519, 16520, 16734, 16973, 17787,
+ 17905, 18084, 18086, 18240, 18265, 18370, 18421, 18480, 18525, 18610,
+ 18618, 18647, 18661, 18674, 18681, 18778, 18781, 18787, 18789, 18790,
+ 18795, 18796, 18820, 18823, 18824, 18863.
* The obsolete header <regexp.h> has been removed. Programs that require
this header must be updated to use <regex.h> instead.
else if (n != 4)
/* Only two or four digits recognized. */
return NULL;
- else
- {
- /* We have to convert the minutes into decimal. */
- if (val % 100 >= 60)
- return NULL;
- val = (val / 100) * 100 + ((val % 100) * 50) / 30;
- }
- if (val > 1200)
+ else if (val % 100 >= 60)
+ /* Minutes valid range is 0 through 59. */
return NULL;
- tm->tm_gmtoff = (val * 3600) / 100;
+ tm->tm_gmtoff = (val / 100) * 3600 + (val % 100) * 60;
if (neg)
tm->tm_gmtoff = -tm->tm_gmtoff;
}
{ "1113472456 -1030", -37800 },
{ "1113472456 +0030", 1800 },
{ "1113472456 -0030", -1800 },
- { "1113472456 -1330", LONG_MAX },
- { "1113472456 +1330", LONG_MAX },
+ { "1113472456 +1157", 43020 },
+ { "1113472456 +1158", 43080 },
+ { "1113472456 +1159", 43140 },
+ { "1113472456 +1200", 43200 },
+ { "1113472456 -1200", -43200 },
+ { "1113472456 +1201", 43260 },
+ { "1113472456 -1201", -43260 },
+ { "1113472456 +1330", 48600 },
+ { "1113472456 -1330", -48600 },
+ { "1113472456 +1400", 50400 },
+ { "1113472456 +1401", 50460 },
+ { "1113472456 -2459", -89940 },
+ { "1113472456 -2500", -90000 },
+ { "1113472456 +2559", 93540 },
+ { "1113472456 +2600", 93600 },
+ { "1113472456 -99", -356400 },
+ { "1113472456 +99", 356400 },
+ { "1113472456 -9959", -359940 },
+ { "1113472456 +9959", 359940 },
{ "1113472456 -1060", LONG_MAX },
{ "1113472456 +1060", LONG_MAX },
{ "1113472456 1030", LONG_MAX },