diff options
author | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2011-11-09 02:04:28 +0200 |
---|---|---|
committer | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2011-11-09 02:04:28 +0200 |
commit | 4a50cd7f46234ed70ba67665def4a4953be5d310 (patch) | |
tree | 9ba4d414a575861fc2cba1cf6b4403e40a1d7fa0 /server | |
parent | ec518ce4326dc3c32165fc56c7c85a3838f14f78 (diff) |
better path's handling
Diffstat (limited to 'server')
-rw-r--r-- | server/proxy_ui_server.workspace | 1 | ||||
-rw-r--r-- | server/server/config.cpp | 18 |
2 files changed, 16 insertions, 3 deletions
diff --git a/server/proxy_ui_server.workspace b/server/proxy_ui_server.workspace index 075d714..30e9c53 100644 --- a/server/proxy_ui_server.workspace +++ b/server/proxy_ui_server.workspace @@ -12,6 +12,7 @@ <Environment> <![CDATA[ + ]]> </Environment> </CodeLite_Workspace> diff --git a/server/server/config.cpp b/server/server/config.cpp index b6b343d..1fa6ca2 100644 --- a/server/server/config.cpp +++ b/server/server/config.cpp @@ -60,7 +60,11 @@ void config::load_proxy_list(char *pth) { std::ifstream config; if(!pth) - config.open("./proxy_list.cfg", std::fstream::in); + { + std::string cfg_path = boost::filesystem::initial_path().string(); + cfg_path += "/proxy_list.cfg"; + config.open(cfg_path.c_str(), std::fstream::in); + } else config.open(pth, std::fstream::in); std::string cfg_str((std::istreambuf_iterator<char>(config)), std::istreambuf_iterator<char>()); @@ -128,7 +132,11 @@ void config::load_static_proxy_list(char *pth) { std::ifstream config; if(!pth) - config.open("./static_proxy_list.cfg", std::fstream::in); + { + std::string cfg_path = boost::filesystem::initial_path().string(); + cfg_path += "/static_proxy_list.cfg"; + config.open(cfg_path.c_str(), std::fstream::in); + } else config.open(pth, std::fstream::in); std::string cfg_str((std::istreambuf_iterator<char>(config)), std::istreambuf_iterator<char>()); @@ -189,7 +197,11 @@ void config::load_firewall_list(char* pth) { std::ifstream config; if(!pth) - config.open("./firewall_list.cfg", std::fstream::in); + { + std::string cfg_path = boost::filesystem::initial_path().string(); + cfg_path += "/firewall_list.cfg"; + config.open(cfg_path.c_str(), std::fstream::in); + } else config.open(pth, std::fstream::in); std::string cfg_str((std::istreambuf_iterator<char>(config)), std::istreambuf_iterator<char>()); |