[systemd-commits] fixme src/util.c src/vconsole-setup.c

Kay Sievers kay at kemper.freedesktop.org
Tue Sep 28 14:42:34 PDT 2010


 fixme                |    2 --
 src/util.c           |    6 ++++++
 src/vconsole-setup.c |    4 ++--
 3 files changed, 8 insertions(+), 4 deletions(-)

New commits:
commit dd36de4d520fc77f0e2ea83f560040d36be3ee50
Author: Kay Sievers <kay.sievers at vrfy.org>
Date:   Tue Sep 28 23:41:09 2010 +0200

    parse_env_file() - return empty value strings like FOO="" as NULL value

diff --git a/fixme b/fixme
index 6b1e864..4291269 100644
--- 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
diff --git a/src/util.c b/src/util.c
index 0939ea9..ce8695b 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 9e5d65d..7703361 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;
         }


More information about the systemd-commits mailing list