]> code.delx.au - gnu-emacs/blobdiff - lib/strftime.c
Use eldoc-documentation-functions
[gnu-emacs] / lib / strftime.c
index c7cec2621c973286bb9b3a95eacaa79d2f879555..4e65190386d5ea311c3f7c2869ef7fc9328b2077 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2001, 2003-2007, 2009-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2001, 2003-2007, 2009-2016 Free Software Foundation, Inc.
 
    NOTE: The canonical source of this file is maintained with the GNU C Library.
    Bugs can be reported to bug-glibc@prep.ai.mit.edu.
@@ -30,6 +30,7 @@
 # else
 #  include "strftime.h"
 # endif
+# include "time-internal.h"
 #endif
 
 #include <ctype.h>
@@ -439,6 +440,9 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
 # define aw_len STRLEN (a_wkday)
 # define am_len STRLEN (a_month)
 # define ap_len STRLEN (ampm)
+#endif
+#if HAVE_TZNAME
+  char **tzname_vec = tzname;
 #endif
   const char *zone;
   size_t i = 0;
@@ -475,6 +479,10 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
     }
   else
     {
+# if !HAVE_TM_ZONE
+      /* Infer the zone name from *TZ instead of from TZNAME.  */
+      tzname_vec = tz->tzname_copy;
+# endif
       /* POSIX.1 requires that local time zone information be used as
          though strftime called tzset.  */
 # if HAVE_TZSET
@@ -483,7 +491,7 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
     }
   /* The tzset() call might have changed the value.  */
   if (!(zone && *zone) && tp->tm_isdst >= 0)
-    zone = tzname[tp->tm_isdst != 0];
+    zone = tzname_vec[tp->tm_isdst != 0];
 #endif
   if (! zone)
     zone = "";
@@ -633,7 +641,7 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
           break;
         }
 
-      /* As a GNU extension we allow to specify the field width.  */
+      /* As a GNU extension we allow the field width to be specified.  */
       if (ISDIGIT (*f))
         {
           width = 0;