]> Sergey Matveev's repositories - nnn.git/commitdiff
Only use the environment variable when it is not empty
authorsin <sin@2f30.org>
Thu, 26 Nov 2015 15:10:12 +0000 (15:10 +0000)
committersin <sin@2f30.org>
Thu, 26 Nov 2015 15:10:12 +0000 (15:10 +0000)
noice.c

diff --git a/noice.c b/noice.c
index 54a9455b7e7d083b201a6ae05cdbb04e226fd4a4..dda028c1fe13ef9781d440aabf3427c7bc3537f2 100644 (file)
--- a/noice.c
+++ b/noice.c
@@ -203,7 +203,7 @@ xgetenv(char *name, char *fallback)
        if (name == NULL)
                return fallback;
        value = getenv(name);
-       return value ? value : fallback;
+       return value && value[0] ? value : fallback;
 }
 
 char *