From: Eli Zaretskii Date: Mon, 31 Dec 2012 16:09:00 +0000 (+0200) Subject: Fix a bug with time zones on MS-Windows. X-Git-Tag: emacs-24.3.90~173^2~7^2~432 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a7f11948344e03745cfc3b52a9089b770966798e;p=emacs.git Fix a bug with time zones on MS-Windows. src/w32.c (unsetenv): Set up the string passed to _putenv correctly. See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html for the bug this caused. --- diff --git a/src/ChangeLog b/src/ChangeLog index 483930a6489..e5d663b746e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2012-12-31 Eli Zaretskii + + * w32.c (unsetenv): Set up the string passed to _putenv + correctly. See + http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html + for the bug this caused. + 2012-12-30 Paul Eggert * coding.c (Qmac): Now static. diff --git a/src/w32.c b/src/w32.c index c9adece652b..5e2080139e1 100644 --- a/src/w32.c +++ b/src/w32.c @@ -1784,6 +1784,7 @@ unsetenv (const char *name) /* It is safe to use 'alloca' with 32K size, since the stack is at least 2MB, and we set it to 8MB in the link command line. */ var = alloca (name_len + 2); + strncpy (var, name, name_len); var[name_len++] = '='; var[name_len] = '\0'; return _putenv (var);