From dd36de4d520fc77f0e2ea83f560040d36be3ee50 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Tue, 28 Sep 2010 23:41:09 +0200 Subject: parse_env_file() - return empty value strings like FOO="" as NULL value --- src/util.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/util.c') diff --git a/src/util.c b/src/util.c index 0939ea9456..ce8695be25 100644 --- a/src/util.c +++ b/src/util.c @@ -653,6 +653,12 @@ int parse_env_file( goto fail; } + if (v[0] == '\0') { + /* return empty value strings as NULL */ + free(v); + v = NULL; + } + free(*value); *value = v; -- cgit v1.2.3-54-g00ecf