aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Pavlik <rpavlik@iastate.edu>2011-10-28 20:44:46 (GMT)
committerRyan Pavlik <rpavlik@iastate.edu>2011-10-31 15:51:38 (GMT)
commitfa63fcdc669efb868ca8979374eca26d82708c38 (patch)
tree8ef859b1a459c865f6bbbe3bfb1c4087596f228b
parent9a2c6f94b8a8c2b078084b552acc58909e831a07 (diff)
downloadfluxbox_paul-fa63fcdc669efb868ca8979374eca26d82708c38.zip
fluxbox_paul-fa63fcdc669efb868ca8979374eca26d82708c38.tar.bz2
main.cc: Check getenv output better.
Windows returns pointers to empty strings for non-existent env vars.
-rw-r--r--src/main.cc4
1 files 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 {
220 const char* env; 220 const char* env;
221 221
222 env = getenv("DISPLAY"); 222 env = getenv("DISPLAY");
223 if (env) { 223 if (env && strlen(env) > 0) {
224 session_display.assign(env); 224 session_display.assign(env);
225 } 225 }
226 226
227 env = getenv("HOME"); 227 env = getenv("HOME");
228 if (env) { 228 if (env && strlen(env) > 0) {
229 rc_path.assign(std::string(env) + "/." + realProgramName("fluxbox")); 229 rc_path.assign(std::string(env) + "/." + realProgramName("fluxbox"));
230 rc_file = rc_path + "/init"; 230 rc_file = rc_path + "/init";
231 } 231 }