chiark / gitweb /
basic: add new merge_env_file function
authorRay Strode <rstrode@redhat.com>
Thu, 4 Aug 2016 16:00:00 +0000 (12:00 -0400)
committerSven Eden <yamakuzure@gmx.net>
Mon, 17 Jul 2017 15:58:34 +0000 (17:58 +0200)
commit70f7776c6e8c549e13adf858c57fe339583c7cec
tree03e421538af1270a9f92d00e5b0ea090bef4ff89
parentf5eb2a086bc5d5d36bc2e4755a1d6b508e202250
basic: add new merge_env_file function

merge_env_file is a new function, that's like load_env_file, but takes a
pre-existing environment as an input argument. New environment entries are
merged. Variable expansion is performed.

Falling back to the process environment is supported (when a flag is set).
Alternatively this could be implemented as passing an additional fallback
environment array, but later on we're adding another flag to allow braceless
expansion, and the two flags can be combined in one arg, so there's less
stuff to pass around.
src/basic/fileio.c
src/basic/fileio.h