all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 13070@debbugs.gnu.org, fabrice.popineau@gmail.com
Subject: bug#13070: Use putenv+unsetenv instead of modifying environ directly
Date: Sat, 08 Dec 2012 11:58:57 -0800	[thread overview]
Message-ID: <50C39C01.1020303@cs.ucla.edu> (raw)
In-Reply-To: <83vccccs5l.fsf@gnu.org>

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.






      reply	other threads:[~2012-12-08 19:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-03 20:32 bug#13070: Use putenv+unsetenv instead of modifying environ directly Paul Eggert
2012-12-04 13:51 ` Fabrice Popineau
2012-12-04 17:48   ` Eli Zaretskii
2012-12-08  4:02   ` Paul Eggert
2012-12-08 11:42     ` Eli Zaretskii
2012-12-08 17:20       ` Paul Eggert
2012-12-08 18:31         ` Eli Zaretskii
2012-12-08 19:58           ` Paul Eggert [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50C39C01.1020303@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=13070@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=fabrice.popineau@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.