all repos — fluxbox @ e2d52a39485d0ab9d5cb5ae027372b612eb32e60

custom fork of the fluxbox windowmanager

bugfix: std::string() does not like NULL on construction

not having DISPLAY set (eg: on a headless system) caused fluxbox to crash.
Mathias Gumz akira at fluxbox dot org
commit

e2d52a39485d0ab9d5cb5ae027372b612eb32e60

parent

650b6f842ba5e996e1159ca78b9bafea9ab58b3c

1 files changed, 19 insertions(+), 6 deletions(-)

jump to
M src/main.ccsrc/main.cc

@@ -216,13 +216,22 @@ << endl;

} struct Options { - Options() : - session_display(getenv("DISPLAY")), - rc_path(std::string(getenv("HOME")) + "/." + realProgramName("fluxbox")), - rc_file(rc_path + "/init"), - xsync(false) { + Options() : xsync(false) { + + const char* env; + + env = getenv("DISPLAY"); + if (env) { + session_display.assign(env); + } + env = getenv("HOME"); + if (env) { + rc_path.assign(std::string(env) + "/." + realProgramName("fluxbox")); + rc_file = rc_path + "/init"; + } } + std::string session_display; std::string rc_path;

@@ -394,7 +403,11 @@

string commandargs = realProgramName("fluxbox-update_configs"); commandargs += " -rc " + rc_file; - system(commandargs.c_str()); + if (system(commandargs.c_str())) { + fbdbg << "running '" + << commandargs + << "' failed." << endl; + } } }