aboutsummaryrefslogtreecommitdiffstats
path: root/lib/strftime.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/strftime.c')
-rw-r--r--lib/strftime.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/strftime.c b/lib/strftime.c
index 9aabcc6748c..e4d78ef7011 100644
--- a/lib/strftime.c
+++ b/lib/strftime.c
@@ -739,11 +739,10 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
739 /* The mask is not what you might think. 739 /* The mask is not what you might think.
740 When the ordinal i'th bit is set, insert a colon 740 When the ordinal i'th bit is set, insert a colon
741 before the i'th digit of the time zone representation. */ 741 before the i'th digit of the time zone representation. */
742#define DO_TZ_OFFSET(d, negative, mask, v) \ 742#define DO_TZ_OFFSET(d, mask, v) \
743 do \ 743 do \
744 { \ 744 { \
745 digits = d; \ 745 digits = d; \
746 negative_number = negative; \
747 tz_colon_mask = mask; \ 746 tz_colon_mask = mask; \
748 u_number_value = v; \ 747 u_number_value = v; \
749 goto do_tz_offset; \ 748 goto do_tz_offset; \
@@ -1444,6 +1443,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
1444 } 1443 }
1445#endif 1444#endif
1446 1445
1446 negative_number = diff < 0 || (diff == 0 && *zone == '-');
1447 hour_diff = diff / 60 / 60; 1447 hour_diff = diff / 60 / 60;
1448 min_diff = diff / 60 % 60; 1448 min_diff = diff / 60 % 60;
1449 sec_diff = diff % 60; 1449 sec_diff = diff % 60;
@@ -1451,13 +1451,13 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
1451 switch (colons) 1451 switch (colons)
1452 { 1452 {
1453 case 0: /* +hhmm */ 1453 case 0: /* +hhmm */
1454 DO_TZ_OFFSET (5, diff < 0, 0, hour_diff * 100 + min_diff); 1454 DO_TZ_OFFSET (5, 0, hour_diff * 100 + min_diff);
1455 1455
1456 case 1: tz_hh_mm: /* +hh:mm */ 1456 case 1: tz_hh_mm: /* +hh:mm */
1457 DO_TZ_OFFSET (6, diff < 0, 04, hour_diff * 100 + min_diff); 1457 DO_TZ_OFFSET (6, 04, hour_diff * 100 + min_diff);
1458 1458
1459 case 2: tz_hh_mm_ss: /* +hh:mm:ss */ 1459 case 2: tz_hh_mm_ss: /* +hh:mm:ss */
1460 DO_TZ_OFFSET (9, diff < 0, 024, 1460 DO_TZ_OFFSET (9, 024,
1461 hour_diff * 10000 + min_diff * 100 + sec_diff); 1461 hour_diff * 10000 + min_diff * 100 + sec_diff);
1462 1462
1463 case 3: /* +hh if possible, else +hh:mm, else +hh:mm:ss */ 1463 case 3: /* +hh if possible, else +hh:mm, else +hh:mm:ss */
@@ -1465,7 +1465,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
1465 goto tz_hh_mm_ss; 1465 goto tz_hh_mm_ss;
1466 if (min_diff != 0) 1466 if (min_diff != 0)
1467 goto tz_hh_mm; 1467 goto tz_hh_mm;
1468 DO_TZ_OFFSET (3, diff < 0, 0, hour_diff); 1468 DO_TZ_OFFSET (3, 0, hour_diff);
1469 1469
1470 default: 1470 default:
1471 goto bad_format; 1471 goto bad_format;