]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix putenv and unsetenv on MS-Windows.
authorEli Zaretskii <eliz@gnu.org>
Sat, 8 Dec 2012 18:27:37 +0000 (20:27 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 8 Dec 2012 18:27:37 +0000 (20:27 +0200)
 src/w32.c (unsetenv): Return 0 if the input string is too long.

 nt/inc/ms-w32.h (sys_putenv): Add prototype.

Fixes: debbugs:13070
nt/ChangeLog
nt/inc/ms-w32.h
src/ChangeLog
src/w32.c

index df6a42595ada72fcbb747614185066327fcf35d5..8cb9594d4d0299a3c5351d0fc19877cca9d32876 100644 (file)
@@ -1,6 +1,7 @@
 2012-12-08  Eli Zaretskii  <eliz@gnu.org>
 
        * inc/ms-w32.h (putenv): Redirect to sys_putenv.
+       (sys_putenv): Add prototype.
 
        * config.nt (HAVE_UNSETENV): Define to 1.
 
index 1cbcb7f88f3da9ae767932bd579033bfb2c1d526..3d68efb804da87833207b6d6333628238e5a6654 100644 (file)
@@ -381,6 +381,7 @@ extern char *get_emacs_configuration_options (void);
 # undef putenv
 #endif
 #define putenv    sys_putenv
+extern int sys_putenv (char *);
 
 extern int getloadavg (double *, int);
 extern int getpagesize (void);
index 0be3eee6726bb844fc2d13bbac832a760eba33d3..222be9575b8a4122ecac1e01b8dbee91c50cee2b 100644 (file)
@@ -1,3 +1,7 @@
+2012-12-08  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32.c (unsetenv): Return 0 if the input string is too long.
+
 2012-12-08  Paul Eggert  <eggert@cs.ucla.edu>
 
        Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
index 203c5cd40ffeddfb91872a8985efd67011c501a4..b6bb653369d5230b56a35d1ef0debbd05e8d46f2 100644 (file)
--- a/src/w32.c
+++ b/src/w32.c
@@ -1562,7 +1562,7 @@ unsetenv (const char *name)
   if (name_len > 32767)
     {
       errno = ENOMEM;
-      return -1;
+      return 0;
     }
   /* 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.  */