[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Out of date comment in setenv.c?

From: Bruno Haible
Subject: Re: Out of date comment in setenv.c?
Date: Fri, 10 Feb 2017 19:17:58 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-62-generic; KDE/5.18.0; x86_64; ; )

Hi Reuben,

> In setenv.c, it says
> /* This function is used by 'setenv' and 'putenv'.  The difference between
>    the two functions is that for the former must create a new string which
>    is then placed in the environment, while the argument of 'putenv'
>    must be used directly.  This is all complicated by the fact that we try
>    to reuse values once generated for a 'setenv' call since we can never
>    free the strings.  */
> int
> __add_to_environ (const char *name, const char *value, const char *combined,
>                   int replace)
> However, I can't see that this function is called anywhere else
> (specifically, not in putenv.c), nor that it ever did (but maybe it's
> indirect?).
> In short, could the text "and 'putenv'" be removed or clarified, please?

setenv.c comes from glibc (file glibc/stdlib/setenv.c). You could guess it
by seeing the _LIBC conditional, or by looking at config/srclist.txt.

In glibc, glibc/stdlib/putenv.c does make use of __add_to_environ. So the
comment is valid in the context of glibc.

In gnulib, we generally try to avoid gratuitous differences to glibc sources,
in order to ease the burden of the occasional re-sync. Therefore I would not
like to change this comment here.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]