diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-03-23 21:31:14 +0100 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-08-24 16:47:08 +0200 |
commit | ff922b481d88c83594c4a97352067f5b17b74e67 (patch) | |
tree | 02f44dd642b2224bd65d6e13f7e23aa63fb764d7 /src/basic/fileio.c | |
parent | 299f585a0692b6e7a438a25a6577fc6f777659ea (diff) |
fileio: accept FILE* in addition to path in parse_env_file()
Most our other parsing functions do this, let's do this here too,
internally we accept that anyway. Also, the closely related
load_env_file() and load_env_file_pairs() also do this, so let's be
systematic.
Diffstat (limited to 'src/basic/fileio.c')
-rw-r--r-- | src/basic/fileio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/basic/fileio.c b/src/basic/fileio.c index 43c804472..0efda65ae 100644 --- a/src/basic/fileio.c +++ b/src/basic/fileio.c @@ -677,6 +677,7 @@ static int parse_env_file_push( } int parse_env_file( + FILE *f, const char *fname, const char *newline, ...) { @@ -687,7 +688,7 @@ int parse_env_file( newline = NEWLINE; va_start(ap, newline); - r = parse_env_file_internal(NULL, fname, newline, parse_env_file_push, &ap, &n_pushed); + r = parse_env_file_internal(f, fname, newline, parse_env_file_push, &ap, &n_pushed); va_end(ap); return r < 0 ? r : n_pushed; |