From a16e75cd3cb27ea5647774bc71625899f35b2fa6 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 8 Dec 2012 20:27:37 +0200 Subject: Fix putenv and unsetenv on MS-Windows. 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 --- src/ChangeLog | 4 ++++ src/w32.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 0be3eee6726..222be9575b8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-12-08 Eli Zaretskii + + * w32.c (unsetenv): Return 0 if the input string is too long. + 2012-12-08 Paul Eggert Use putenv+unsetenv instead of modifying environ directly (Bug#13070). diff --git a/src/w32.c b/src/w32.c index 203c5cd40ff..b6bb653369d 100644 --- 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. */ -- cgit v1.2.1