about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-04-12 15:28:49 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-04-12 15:28:49 +0000
commitfc615adad738c1a7de77c90446fef49afac31302 (patch)
tree306ee606c710c3bc1415c1bdb00514f96db8b261
parentaeaf47aeebccd71f533bdd926cb054e0bd8fb0aa (diff)
downloadzsh-fc615adad738c1a7de77c90446fef49afac31302.tar.gz
zsh-fc615adad738c1a7de77c90446fef49afac31302.tar.xz
zsh-fc615adad738c1a7de77c90446fef49afac31302.zip
23270: fix strptime() on Solaris
-rw-r--r--ChangeLog5
-rw-r--r--Src/system.h12
2 files changed, 17 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d7dfad425..34ca8005a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-04-12  Peter Stephenson  <pws@csr.com>
+
+	* 23270: Src/system.h: #define _STRPTIME_DONTZERO to get Solaris
+	strptime() to work properly.
+
 2007-04-05  Clint Adams  <clint@zsh.org>
 
 	* 23264: Src/Modules/pcre.c: don't add the -pcre-match
diff --git a/Src/system.h b/Src/system.h
index 2f3dcd32a..fafa5dd01 100644
--- a/Src/system.h
+++ b/Src/system.h
@@ -52,6 +52,18 @@
 # undef HAVE_SYS_UTSNAME_H
 #endif
 
+/*
+ * Solaris by default zeroes all elements of the tm structure in
+ * strptime().  Unfortunately that gives us no way of telling whether
+ * the tm_isdst element has been set from the input pattern.  If it
+ * hasn't we want it to be -1 (undetermined) on input to mktime().  So
+ * we stop strptime() zeroing the struct tm and instead set all the
+ * elements ourselves.
+ *
+ * This is likely to be harmless everywhere else.
+ */
+#define _STRPTIME_DONTZERO
+
 #ifdef PROTOTYPES
 # define _(Args) Args
 #else