summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Dickens <mlk@alum.mit.edu>2013-10-28 20:58:46 -0400
committerNicholas Corgan <nick.corgan@ettus.com>2013-10-29 09:34:18 -0700
commit44895b30b71be7b7e851ca04388d0f6d18f4aefd (patch)
tree8a05fe7e138f07f15b8d6f8368438dcceb973674
parentf759a6eb69c47be7b089212f635cc173617cf232 (diff)
downloaduhd-44895b30b71be7b7e851ca04388d0f6d18f4aefd.tar.gz
uhd-44895b30b71be7b7e851ca04388d0f6d18f4aefd.tar.bz2
uhd-44895b30b71be7b7e851ca04388d0f6d18f4aefd.zip
utils: fix declaration of "env_path_sep" such that it is always initialized before it is used in the "get_env_paths" function, by moving it from the global scope to inside that function. This change allows UHD_STATIC_BLOCK(load_modules) to work correctly.
-rw-r--r--host/lib/utils/paths.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/host/lib/utils/paths.cpp b/host/lib/utils/paths.cpp
index 26fa6d1c7..6e0dd13bd 100644
--- a/host/lib/utils/paths.cpp
+++ b/host/lib/utils/paths.cpp
@@ -34,8 +34,19 @@
namespace fs = boost::filesystem;
/***********************************************************************
+ * Get a list of paths for an environment variable
+ **********************************************************************/
+static std::string get_env_var(const std::string &var_name, const std::string &def_val = ""){
+ const char *var_value_ptr = std::getenv(var_name.c_str());
+ return (var_value_ptr == NULL)? def_val : var_value_ptr;
+}
+
+static std::vector<fs::path> get_env_paths(const std::string &var_name){
+
+/***********************************************************************
* Determine the paths separator
**********************************************************************/
+
#ifdef UHD_PLATFORM_WIN32
static const std::string env_path_sep = ";";
#else
@@ -46,16 +57,6 @@ namespace fs = boost::filesystem;
boost::tokenizer<boost::char_separator<char> > \
(inp, boost::char_separator<char>(env_path_sep.c_str()))
-/***********************************************************************
- * Get a list of paths for an environment variable
- **********************************************************************/
-static std::string get_env_var(const std::string &var_name, const std::string &def_val = ""){
- const char *var_value_ptr = std::getenv(var_name.c_str());
- return (var_value_ptr == NULL)? def_val : var_value_ptr;
-}
-
-static std::vector<fs::path> get_env_paths(const std::string &var_name){
-
std::string var_value = get_env_var(var_name);
//convert to filesystem path, filter blank paths