main.cc: Check getenv output better.

Windows returns pointers to empty strings for non-existent env vars.
This commit is contained in:
Ryan Pavlik 2011-10-28 15:44:46 -05:00
parent 9a2c6f94b8
commit fa63fcdc66

View file

@ -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";
}