commit bash-20040816 snapshot

This commit is contained in:
Chet Ramey
2011-12-03 13:35:02 -05:00
parent 8ed8525cb1
commit de3341d16e
26 changed files with 15436 additions and 112 deletions
+14 -1
View File
@@ -80,6 +80,10 @@
#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);
@@ -98,8 +102,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 +488,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 */