From fa63fcdc669efb868ca8979374eca26d82708c38 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Fri, 28 Oct 2011 15:44:46 -0500 Subject: main.cc: Check getenv output better. Windows returns pointers to empty strings for non-existent env vars. --- src/main.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cc b/src/main.cc index c47e1d8..eaa732d 100644 --- a/src/main.cc +++ b/src/main.cc @@ -220,12 +220,12 @@ struct Options { const char* env; env = getenv("DISPLAY"); - if (env) { + if (env && strlen(env) > 0) { session_display.assign(env); } env = getenv("HOME"); - if (env) { + if (env && strlen(env) > 0) { rc_path.assign(std::string(env) + "/." + realProgramName("fluxbox")); rc_file = rc_path + "/init"; } -- cgit v0.11.2