GNU bug report logs - #13070
Use putenv+unsetenv instead of modifying environ directly

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Mon, 3 Dec 2012 20:37:01 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 13070 <at> debbugs.gnu.org, fabrice.popineau <at> gmail.com
Subject: bug#13070: Use putenv+unsetenv instead of modifying environ directly
Date: Sat, 08 Dec 2012 11:58:57 -0800
On 12/08/2012 10:31 AM, Eli Zaretskii wrote:

> What about NULL pointers?

putenv typically dumps core when passed NULL,
so checking errno afterwards wouldn't help.

> Or strings without a '='?

Typically that's valid; it's equivalent to unsetenv.
So typically, checking errno afterwards wouldn't help.

> it's silly to rely on unspecified behavior

Emacs doesn't rely on unspecified behavior, since it never
passes NULL or '='-less strings to xputenv.

Emacs has many, many places where we could
put easserts, but we don't bother because the disadvantages
of code clutter outweigh any advantages of catching bugs,
and this appears to be one of those places.





This bug report was last modified 12 years and 228 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.