summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2010-09-28 23:41:09 +0200
committerKay Sievers <kay.sievers@vrfy.org>2010-09-28 23:41:09 +0200
commitdd36de4d520fc77f0e2ea83f560040d36be3ee50 (patch)
tree6b9b5da9b74280bddc22e02cfa8bfb47b2c64406 /src
parent34c8deaae1fcfa9e7c9db49b5f3a33973e103218 (diff)
parse_env_file() - return empty value strings like FOO="" as NULL value
Diffstat (limited to 'src')
-rw-r--r--src/util.c6
-rw-r--r--src/vconsole-setup.c4
2 files changed, 8 insertions, 2 deletions
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;
diff --git a/src/vconsole-setup.c b/src/vconsole-setup.c
index 9e5d65da65..7703361e33 100644
--- a/src/vconsole-setup.c
+++ b/src/vconsole-setup.c
@@ -113,11 +113,11 @@ static int load_font(const char *vc, const char *font, const char *map, const ch
args[i++] = "-C";
args[i++] = vc;
args[i++] = font;
- if (map && map[0] != '\0') {
+ if (map) {
args[i++] = "-m";
args[i++] = map;
}
- if (unimap && unimap[0] != '\0') {
+ if (unimap) {
args[i++] = "-u";
args[i++] = unimap;
}