]> err.no Git - systemd/commitdiff
parse_env_file() - return empty value strings like FOO="" as NULL value
authorKay Sievers <kay.sievers@vrfy.org>
Tue, 28 Sep 2010 21:41:09 +0000 (23:41 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Tue, 28 Sep 2010 21:41:09 +0000 (23:41 +0200)
fixme
src/util.c
src/vconsole-setup.c

diff --git a/fixme b/fixme
index 6b1e8640045fa27bda727d428d1eaf1e667223af..4291269b587b6c44904e11d65b958858722e664a 100644 (file)
--- a/fixme
+++ b/fixme
@@ -9,8 +9,6 @@ v11:
 
 * emergency.service should start default.target after C-d. synchronize from fedora's initscripts package
 
-* drop empty assignments for parse_env_file
-
 * stability promise must say that #ifdef TARGET_XXX style distro compatibility will go away one day
 
 * enable tmpfiles by default
index 0939ea9456bde70eaf193a65002ffe8d0665774c..ce8695be25f6c3fad0ee1e2b06028278b93db824 100644 (file)
@@ -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;
 
index 9e5d65da657ecfbb4d7664673a24b6fc86145be5..7703361e33ef6029f372a04006d1806fe989a452 100644 (file)
@@ -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;
         }