Otto Moerbeek:

> > Is it possible that char* (env_vers_cstr) points to null or garbage
> > because env changed? Or is this nonsense and this cannot happen and
> > env_vers_cstr is always valid with the first match?
> 
> No, Posix allows previous values of getenv() to be invalidated by
> subsequenct calls to setenv(), plus a few other conditions.

To clarify: The environment is within the process's address space.
Neither the parent nor any other process can change it.  However,
the process itself can modify it, which is where putenv() etc. come
in.

-- 
Christian "naddy" Weisgerber                          [email protected]

Reply via email to