changeset 36479:ac3ee681e8f9

(Fcurrent_time_zone) [HAVE_TM_ZONE || HAVE_TZNAME]: Accept only alphanumeric time zone names.
author Gerd Moellmann <gerd@gnu.org>
date Fri, 02 Mar 2001 12:56:48 +0000
parents 742df7c33f75
children 59455f09babf
files src/editfns.c
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/editfns.c	Fri Mar 02 12:34:45 2001 +0000
+++ b/src/editfns.c	Fri Mar 02 12:56:48 2001 +0000
@@ -1757,6 +1757,20 @@
 	s = tzname[t->tm_isdst];
 #endif
 #endif /* not HAVE_TM_ZONE */
+
+#if defined HAVE_TM_ZONE || defined HAVE_TZNAME
+      if (s)
+	{
+	  /* On Japanese w32, we can get a Japanese string as time
+	     zone name.  Don't accept that.  */
+	  char *p;
+	  for (p = s; *p && isalnum (*p); ++p)
+	    ;
+	  if (p == s || *p)
+	    s = NULL;
+	}
+#endif
+
       if (!s)
 	{
 	  /* No local time zone name is available; use "+-NNNN" instead.  */