summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2005-07-04 05:06:44 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2005-07-04 05:06:44 +0000
commitd96382a5e91187ccfed6468f8cd206b29de943de (patch)
treedbf4629f2cc18734d85c31fab389c837fc8f797e
parentca039b42dcd520065176e98bbdf928f8ceb9e180 (diff)
downloadcoreutils-d96382a5e91187ccfed6468f8cd206b29de943de.tar.xz
(my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
Copy the input structure, to work around some of the bug with Solaris 2.5.1 and Solaris 2.6.
-rw-r--r--lib/strftime.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/strftime.c b/lib/strftime.c
index 37c51232b..fb7354efd 100644
--- a/lib/strftime.c
+++ b/lib/strftime.c
@@ -373,13 +373,6 @@ static CHAR_T const month_name[][10] =
# define ns 0
#endif
-#if ! defined _LIBC && ! HAVE_RUN_TZSET_TEST
-/* Solaris 2.5.x and 2.6 tzset sometimes modify the storage returned
- by localtime. On such systems, we must use the tzset and localtime
- wrappers to work around the bug. */
-"you must run the autoconf test for a working tzset function"
-#endif
-
/* Write information from TP into S according to the format
string FORMAT, writing no more that MAXSIZE characters
@@ -439,6 +432,15 @@ my_strftime (CHAR_T *s, size_t maxsize, const CHAR_T *format,
const char *format_end = NULL;
#endif
+#if ! defined _LIBC && ! HAVE_RUN_TZSET_TEST
+ /* Solaris 2.5.x and 2.6 tzset sometimes modify the storage returned
+ by localtime. On such systems, we must either use the tzset and
+ localtime wrappers to work around the bug (which sets
+ HAVE_RUN_TZSET_TEST) or make a copy of the structure. */
+ struct tm copy = *tp;
+ tp = &copy;
+#endif
+
zone = NULL;
#if HAVE_TM_ZONE
/* The POSIX test suite assumes that setting