diff options
author | Mathias Gumz <akira at fluxbox dot org> | 2013-06-29 06:39:02 (GMT) |
---|---|---|
committer | Mathias Gumz <akira at fluxbox dot org> | 2013-06-29 06:39:02 (GMT) |
commit | f464f24eb3a5872404f60356009f466d5f79f2b1 (patch) | |
tree | 285557bd93d1f1825f21ced9766e1bcfeb2f90fc /util | |
parent | 2efd4b823082efb45cb351c7185d510ccb1dd32a (diff) | |
download | fluxbox-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.cc | 3 |
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; | |||
64 | using std::map; | 64 | using std::map; |
65 | using std::list; | 65 | using std::list; |
66 | using std::exit; | 66 | using std::exit; |
67 | using std::getenv; | ||
68 | 67 | ||
69 | string read_file(const string& filename); | 68 | string read_file(const string& filename); |
70 | void write_file(const string& filename, const string &contents); | 69 | void 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())) { |