summaryrefslogtreecommitdiff
path: root/lib/sh/strftime.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sh/strftime.c')
-rw-r--r--lib/sh/strftime.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sh/strftime.c b/lib/sh/strftime.c
index 0783d28..572baae 100644
--- a/lib/sh/strftime.c
+++ b/lib/sh/strftime.c
@@ -1,7 +1,7 @@
+/* strftime - formatted time and date to a string */
/*
* Modified slightly by Chet Ramey for inclusion in Bash
*/
-
/*
* strftime.c
*
@@ -471,6 +471,8 @@ strftime(char *s, size_t maxsize, const char *format, const struct tm *timeptr)
* us that muck around with various message processors.
*/
case 'z': /* time zone offset east of GMT e.g. -0600 */
+ if (timeptr->tm_isdst < 0)
+ break;
#ifdef HAVE_TM_NAME
/*
* Systems with tm_name probably have tm_tzadj as
@@ -493,7 +495,7 @@ strftime(char *s, size_t maxsize, const char *format, const struct tm *timeptr)
# ifdef HPUX
off = -timezone / 60;
# else
- off = -(daylight ? timezone : altzone) / 60;
+ off = -(daylight ? altzone : timezone) / 60;
# endif /* !HPUX */
#else /* !HAVE_TZNAME */
gettimeofday(& tv, & zone);