Fix a bug with time zones on MS-Windows.
authorEli Zaretskii <eliz@gnu.org>
Mon, 31 Dec 2012 16:09:00 +0000 (18:09 +0200)
committerEli Zaretskii <eliz@gnu.org>
Mon, 31 Dec 2012 16:09:00 +0000 (18:09 +0200)
 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.

src/ChangeLog
src/w32.c

index 483930a..e5d663b 100644 (file)
@@ -1,3 +1,10 @@
+2012-12-31  Eli Zaretskii  <eliz@gnu.org>
+
+       * 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  <eggert@cs.ucla.edu>
 
        * coding.c (Qmac): Now static.
index c9adece..5e20801 100644 (file)
--- 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);