aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sh/strftime.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sh/strftime.c')
-rw-r--r--lib/sh/strftime.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/sh/strftime.c b/lib/sh/strftime.c
index 4cb542f..0783d28 100644
--- a/lib/sh/strftime.c
+++ b/lib/sh/strftime.c
@@ -80,15 +80,21 @@
#undef strchr /* avoid AIX weirdness */
+#if defined (SHELL)
+extern char *get_string_value (const char *);
+#endif
+
extern void tzset(void);
static int weeknumber(const struct tm *timeptr, int firstweekday);
static int iso8601wknum(const struct tm *timeptr);
+#ifndef inline
#ifdef __GNUC__
#define inline __inline__
#else
#define inline /**/
#endif
+#endif
#define range(low, item, hi) max(low, min(item, hi))
@@ -98,8 +104,12 @@ extern int daylight;
#if defined(SOLARIS) || defined(mips) || defined (M_UNIX)
extern long int timezone, altzone;
#else
+# if defined (HPUX)
+extern long int timezone;
+# else
extern int timezone, altzone;
-#endif
+# endif /* !HPUX */
+#endif /* !SOLARIS && !mips && !M_UNIX */
#endif
#undef min /* just in case */
@@ -480,8 +490,13 @@ strftime(char *s, size_t maxsize, const char *format, const struct tm *timeptr)
* Systems with tzname[] probably have timezone as
* secs west of GMT. Convert to mins east of GMT.
*/
+# ifdef HPUX
+ off = -timezone / 60;
+# else
off = -(daylight ? timezone : altzone) / 60;
+# endif /* !HPUX */
#else /* !HAVE_TZNAME */
+ gettimeofday(& tv, & zone);
off = -zone.tz_minuteswest;
#endif /* !HAVE_TZNAME */
#endif /* !HAVE_TM_ZONE */