X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=lib%2Fsh%2Fstrftime.c;h=0783d28da92b27bc4163e13b3fa604dcda4de04c;hb=95732b497d12c98613bb3c5db16b61f377501a59;hp=253d1df4cd1529627a864bf7382de8a1bdead710;hpb=7117c2d221b2aed4ede8600f6a36b7c1454b4f55;p=platform%2Fupstream%2Fbash.git diff --git a/lib/sh/strftime.c b/lib/sh/strftime.c index 253d1df..0783d28 100644 --- a/lib/sh/strftime.c +++ b/lib/sh/strftime.c @@ -80,26 +80,36 @@ #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)) #if !defined(OS2) && !defined(MSDOS) && defined(HAVE_TZNAME) extern char *tzname[2]; extern int daylight; -#if defined(SOLARIS) || defined(mips) +#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 */