From baf5dce0dd63336a6a0eaa80a5138c397e637a83 Mon Sep 17 00:00:00 2001 From: eidheim Date: Tue, 3 Nov 2015 20:44:09 +0100 Subject: [PATCH] Renamed for instance locations to more suitable environment_variables. --- src/config.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/config.cc b/src/config.cc index ae8a5f7..faac2ba 100644 --- a/src/config.cc +++ b/src/config.cc @@ -9,10 +9,10 @@ using namespace std; //TODO: remove Config::Config() { - std::vector locations = {"JUCI_HOME", "HOME", "AppData"}; + std::vector environment_variables = {"JUCI_HOME", "HOME", "AppData"}; char *ptr = nullptr; - for (auto &location : locations) { - ptr=std::getenv(location.c_str()); + for (auto &variable : environment_variables) { + ptr=std::getenv(variable.c_str()); if (ptr!=nullptr && boost::filesystem::exists(ptr)) { home /= ptr; home /= ".juci"; @@ -21,8 +21,8 @@ Config::Config() { } if(home.empty()) { std::string searched_envs = "["; - for(auto &location : locations) - searched_envs+=location+", "; + for(auto &variable : environment_variables) + searched_envs+=variable+", "; searched_envs.erase(searched_envs.end()-2, searched_envs.end()); searched_envs+="]"; throw std::runtime_error("One of these environment variables needs to point to a writable directory to save configuration: " + searched_envs);