all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Wolfgang Jenkner <wjenkner@inode.at>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 19874@debbugs.gnu.org, Ashish SHUKLA <ashish.is@lostca.se>
Subject: bug#19874: 25.0.50; encode-time not working as expected
Date: Sun, 01 Mar 2015 17:42:22 +0100	[thread overview]
Message-ID: <85vbikvewg.fsf@iznogoud.viz> (raw)
In-Reply-To: <86vbj35m3n.fsf@chateau.d.if>

On Sat, Feb 28 2015, Paul Eggert wrote:

> Wolfgang Jenkner wrote:
>> No, I think about the parenthetical remark above: It states `copying the
>> environment strings' and not `copying the pointers to the environment
>> strings'.  Normally, in documentation, copying a `string' refers to the
>> object, i.e the region in memory it occupies, not to the pointer
>> designating it.
>
> That interpretation of the rationale is inconsistent with how putenv
> is required to behave.  If one uses putenv to add a string to the
> environment, one can later alter the string (via strcpy, say), and
> this changes the environment; this is quite clear from the normative
> text.  Under the above interpretation, however, getenv could copy the
> string's contents somewhere else, which would mean that modifying the
> putenv-supplied string would not change the environment.

Sure, if putenv is supported it must be compatible with getenv (as the
standard states) and the interpretation of the rationale in this case
implies that getenv can't copy the strings' content, but setenv may,
IIUC (I'm still just wondering if the test program you posted is
conforming).

> If the rationale were intended to discuss copying the strings'
> contents, then its sentence "copying the environment strings into
> a new array and assigning environ to point to it" would be incorrect,
> as one would not assign environ to point to the new array containing
> the strings' contents, but rather one would assign environ[0],
> environ[1], environ[2], etc. to point within the new array. The
> context of that part of the rationale makes it clear that "assign to
> environ" means "environ = SOMETHING", not "environ[0] = SOMETHING".

Yes, I was simply thinking about something like

	q = environ_tmp;
	for (p = environ; *p; p++, q++)
		*q = strdup(*p);
	environ = environ_tmp;





  parent reply	other threads:[~2015-03-01 16:42 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-15 13:40 bug#19874: 25.0.50; encode-time not working as expected Ashish SHUKLA
2015-02-15 23:33 ` Ashish SHUKLA
2015-02-25 17:41 ` Paul Eggert
2015-02-26  0:24   ` Ashish SHUKLA
2015-02-26  8:15     ` Paul Eggert
2015-02-26 13:42       ` Wolfgang Jenkner
2015-02-26 17:36         ` Wolfgang Jenkner
2015-02-26 17:58         ` Paul Eggert
2015-02-26 16:03       ` Ashish SHUKLA
2015-02-26  6:51   ` Ashish SHUKLA
2015-02-26  8:39     ` Paul Eggert
2015-02-26 15:58       ` Ashish SHUKLA
2015-02-27  5:13         ` Paul Eggert
2015-02-26 19:00 ` Wolfgang Jenkner
2015-02-26 19:44   ` Ashish SHUKLA
2015-02-26 20:05     ` Wolfgang Jenkner
2015-02-26 21:47       ` Ashish SHUKLA
2015-02-27  0:16         ` Wolfgang Jenkner
2015-02-27  2:51         ` Wolfgang Jenkner
2015-02-27  4:59           ` Ashish SHUKLA
2015-02-27  6:38             ` Paul Eggert
2015-02-27  8:09             ` Paul Eggert
2015-02-27  8:49               ` Ashish SHUKLA
2015-02-27  6:31   ` Paul Eggert
2015-02-27  8:28 ` Ashish SHUKLA
2015-02-27 16:41   ` Paul Eggert
2015-02-27 17:33 ` Wolfgang Jenkner
2015-02-27 23:54   ` Paul Eggert
2015-02-28 14:10     ` Wolfgang Jenkner
2015-02-28 14:18       ` Wolfgang Jenkner
2015-02-28 19:43       ` Paul Eggert
2015-03-01 16:42 ` Wolfgang Jenkner [this message]
2015-03-01 18:28   ` Paul Eggert
2015-03-01 22:49 ` Wolfgang Jenkner

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=85vbikvewg.fsf@iznogoud.viz \
    --to=wjenkner@inode.at \
    --cc=19874@debbugs.gnu.org \
    --cc=ashish.is@lostca.se \
    --cc=eggert@cs.ucla.edu \
    /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.