Mercurial > emacs
diff src/editfns.c @ 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 | 5cf8398ba424 |
children | a9b2639dd045 |
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. */