cmdline/env: don't set empty envvars
authorRobert Swiecki <robert@swiecki.net>
Sun, 28 Oct 2018 20:03:10 +0000 (21:03 +0100)
committerRobert Swiecki <robert@swiecki.net>
Sun, 28 Oct 2018 20:03:10 +0000 (21:03 +0100)
cmdline.cc

index 0da4c2e..46bd10d 100644 (file)
@@ -194,7 +194,8 @@ void addEnv(nsjconf_t* nsjconf, const std::string& env) {
        }
        char* e = getenv(env.c_str());
        if (!e) {
-               nsjconf->envs.push_back(env);
+               LOG_W("Requested to use the '%s' envvar, but it's not set. It'll be ignored",
+                   env.c_str());
                return;
        }
        nsjconf->envs.push_back(std::string(env).append("=").append(e));