GNU bug report logs -
#19874
25.0.50; encode-time not working as expected
Previous Next
Reported by: ashish.is <at> lostca.se (Ashish SHUKLA)
Date: Sun, 15 Feb 2015 13:42:01 UTC
Severity: normal
Found in version 25.0.50
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
Message #106 received at 19874 <at> debbugs.gnu.org (full text, mbox):
On Sun, Mar 01 2015, Paul Eggert wrote:
>> I was simply thinking about something like
>>
>> q = environ_tmp;
>> for (p = environ; *p; p++, q++)
>> *q = strdup(*p);
>> environ = environ_tmp;
>
> The behavior of getenv, setenv, etc. are undefined after a program
> modifies environ[0], environ[1], etc. See POSIX 8.1
> <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_01>. So,
> although a POSIX-conforming program can do the above, it can't use
> getenv etc. afterwards.
The parenthetical remark in the getenv RATIONALE section is about what
the *implementation* may do.
the implementation can at that point reinitialize based on the new
environment. (This may include copying the environment strings into
a new array and assigning environ to point to it.)
The code snippet above just illustrates a possible interpretation of the
parenthetical remark above.
This bug report was last modified 5 years and 118 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.