summaryrefslogtreecommitdiffstats
path: root/host/lib/utils/paths.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/utils/paths.cpp')
-rw-r--r--host/lib/utils/paths.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/host/lib/utils/paths.cpp b/host/lib/utils/paths.cpp
index 9e9525caf..f2037a38d 100644
--- a/host/lib/utils/paths.cpp
+++ b/host/lib/utils/paths.cpp
@@ -17,7 +17,7 @@
#include "constants.hpp"
#include <uhd/config.hpp>
-#include <uhd/utils/algorithm.hpp>
+#include <boost/tokenizer.hpp>
#include <boost/program_options.hpp>
#include <boost/filesystem.hpp>
#include <boost/foreach.hpp>
@@ -38,6 +38,10 @@ namespace fs = boost::filesystem;
static const std::string env_path_sep = ":";
#endif /*UHD_PLATFORM_WIN32*/
+#define path_tokenizer(inp) \
+ 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
**********************************************************************/
@@ -60,7 +64,7 @@ static std::vector<fs::path> get_env_paths(const std::string &var_name){
//convert to filesystem path, filter blank paths
std::vector<fs::path> paths;
- BOOST_FOREACH(const std::string &path_string, std::split_string(var_value, env_path_sep)){
+ BOOST_FOREACH(const std::string &path_string, path_tokenizer(var_value)){
if (path_string.empty()) continue;
paths.push_back(fs::system_complete(path_string));
}