aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2013-06-29 06:39:02 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2013-06-29 06:39:02 (GMT)
commitf464f24eb3a5872404f60356009f466d5f79f2b1 (patch)
tree285557bd93d1f1825f21ced9766e1bcfeb2f90fc /util
parent2efd4b823082efb45cb351c7185d510ccb1dd32a (diff)
downloadfluxbox-f464f24eb3a5872404f60356009f466d5f79f2b1.zip
fluxbox-f464f24eb3a5872404f60356009f466d5f79f2b1.tar.bz2
fix detection of $HOME folder
usually $HOME is set when fluxbox runs. in some rare scenarios (eg., fuzzying binaries to detect bugs) one could launch fluxbox by using 'env -i' and thus eliminating $HOME from the environment. to prevent crashes fluxbox uses now 'getpwuid()' when $HOME is not set to detect the home folder.
Diffstat (limited to 'util')
-rw-r--r--util/fluxbox-update_configs.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/util/fluxbox-update_configs.cc b/util/fluxbox-update_configs.cc
index a8052a2..8eff8e4 100644
--- a/util/fluxbox-update_configs.cc
+++ b/util/fluxbox-update_configs.cc
@@ -64,7 +64,6 @@ using std::set;
64using std::map; 64using std::map;
65using std::list; 65using std::list;
66using std::exit; 66using std::exit;
67using std::getenv;
68 67
69string read_file(const string& filename); 68string read_file(const string& filename);
70void write_file(const string& filename, const string &contents); 69void write_file(const string& filename, const string &contents);
@@ -615,7 +614,7 @@ int main(int argc, char **argv) {
615 } 614 }
616 615
617 if (rc_filename.empty()) 616 if (rc_filename.empty())
618 rc_filename = getenv("HOME") + string("/.fluxbox/init"); 617 rc_filename = FbTk::StringUtil::expandFilename("~/.fluxbox/init");
619 618
620 FbTk::ResourceManager resource_manager(rc_filename.c_str(),false); 619 FbTk::ResourceManager resource_manager(rc_filename.c_str(),false);
621 if (!resource_manager.load(rc_filename.c_str())) { 620 if (!resource_manager.load(rc_filename.c_str())) {