aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorBen Hilburn <ben.hilburn@ettus.com>2015-02-10 15:56:50 -0800
committerBen Hilburn <ben.hilburn@ettus.com>2015-02-10 15:56:50 -0800
commitb10c9dd446f0b0567e6b16add0fc8004d465d76e (patch)
tree399ca6d6997ca26be9e4701e668234c2de83dfc6 /host/lib
parent4dc4c3cd700db5b1e66ca2be275bf5f743a75c8e (diff)
downloaduhd-b10c9dd446f0b0567e6b16add0fc8004d465d76e.tar.gz
uhd-b10c9dd446f0b0567e6b16add0fc8004d465d76e.tar.bz2
uhd-b10c9dd446f0b0567e6b16add0fc8004d465d76e.zip
uhd::paths - fixing `get_app_path` to use correct `get_env_var` function
Also added new enviornment variable, "UHDCALIBPATH", so that users can use something other than system-required environment paths.
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/utils/paths.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/host/lib/utils/paths.cpp b/host/lib/utils/paths.cpp
index e304555bd..235c2607d 100644
--- a/host/lib/utils/paths.cpp
+++ b/host/lib/utils/paths.cpp
@@ -173,11 +173,14 @@ std::string uhd::get_tmp_path(void){
}
std::string uhd::get_app_path(void){
- const char *appdata_path = std::getenv("APPDATA");
- if (appdata_path != NULL) return appdata_path;
+ const std::string uhdcalib_path = get_env_var("UHDCALIBPATH");
+ if (not uhdcalib_path.empty()) return uhdcalib_path;
- const char *home_path = std::getenv("HOME");
- if (home_path != NULL) return home_path;
+ const std::string appdata_path = get_env_var("APPDATA");
+ if (not appdata_path.empty()) return appdata_path;
+
+ const std::string home_path = get_env_var("HOME");
+ if (not home_path.empty()) return home_path;
return uhd::get_tmp_path();
}