]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/test/test-fileio.c
basic: add new merge_env_file function
authorRay Strode <rstrode@redhat.com>
Thu, 4 Aug 2016 16:00:00 +0000 (12:00 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 20 Feb 2017 23:49:14 +0000 (18:49 -0500)
commit37f3ffca273e5238794019caede7b7cd33a5de3a
treee33c5556d5cb2dd89064d8c3344b904fd8853f47
parentd8ad241f54b8c4ac76aafd960d89b47b0ed87fb6
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/env-util.c
src/basic/env-util.h
src/basic/fileio.c
src/basic/fileio.h
src/test/test-env-util.c
src/test/test-fileio.c