all repos — fluxbox @ 80e8cd071e05305d0fc70fa6d78991cf9b50d7e4

custom fork of the fluxbox windowmanager

just use the FbTk API
Mathias Gumz akira at fluxbox dot org
commit

80e8cd071e05305d0fc70fa6d78991cf9b50d7e4

parent

1b4596ee852eaa770064f2711a1b6445a6c4303d

2 files changed, 8 insertions(+), 4 deletions(-)

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

@@ -28,6 +28,7 @@ #include "WindowCmd.hh"

#include "FbTk/EventManager.hh" #include "FbTk/StringUtil.hh" +#include "FbTk/FileUtil.hh" #include "FbTk/App.hh" #include "FbTk/Command.hh" #include "FbTk/RefCount.hh"

@@ -275,6 +276,10 @@ return;

} FbTk::App::instance()->sync(false); + + if (! FbTk::FileUtil::isRegularFile(m_filename.c_str())) { + return; + } // open the file ifstream infile(m_filename.c_str());
M util/fluxbox-update_configs.ccutil/fluxbox-update_configs.cc

@@ -22,6 +22,7 @@

#include "../src/FbTk/I18n.hh" #include "../src/FbTk/Resource.hh" #include "../src/FbTk/StringUtil.hh" +#include "../src/FbTk/FileUtil.hh" #include "defaults.hh"

@@ -473,11 +474,9 @@ map<string,string>::iterator it = file_cache.find(filename);

if (it != file_cache.end()) return it->second; - struct stat s; - stat(filename.c_str(), &s); - - if (! (s.st_mode & S_IFREG)) + if (!FbTk::FileUtil::isRegularFile(filename.c_str())) { return ""; + } // nope, we'll have to read the file ifstream infile(filename.c_str());