summaryrefslogtreecommitdiff
path: root/volk/lib
diff options
context:
space:
mode:
authorTom Rondeau2012-03-27 21:46:48 -0400
committerTom Rondeau2012-03-27 21:46:48 -0400
commit8bfb47dd8fb661039bdfdc475047e6f983f11270 (patch)
tree448402699fabea713d3f54b35e7733617d273ab3 /volk/lib
parentda09d2b000606b55f564bc6adaa945968d6c3e72 (diff)
parent79e341d9064b8e44c2d1900cb34ddb51deebb559 (diff)
downloadgnuradio-8bfb47dd8fb661039bdfdc475047e6f983f11270.tar.gz
gnuradio-8bfb47dd8fb661039bdfdc475047e6f983f11270.tar.bz2
gnuradio-8bfb47dd8fb661039bdfdc475047e6f983f11270.zip
Merge branch 'master' of gnuradio.org:gnuradio
Diffstat (limited to 'volk/lib')
-rw-r--r--volk/lib/volk_prefs.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/volk/lib/volk_prefs.c b/volk/lib/volk_prefs.c
index b29d5fd87..7e705bed4 100644
--- a/volk/lib/volk_prefs.c
+++ b/volk/lib/volk_prefs.c
@@ -9,7 +9,14 @@
void get_config_path(char *path) {
const char *suffix = "/.volk/volk_config";
- strcpy(path, getenv("HOME"));
+ char *home = NULL;
+ if (home == NULL) home = getenv("HOME");
+ if (home == NULL) home = getenv("APPDATA");
+ if (home == NULL){
+ path = NULL;
+ return;
+ }
+ strcpy(path, home);
strcat(path, suffix);
}
@@ -22,6 +29,7 @@ int load_preferences(struct volk_arch_pref **prefs) {
//get the config path
get_config_path(path);
+ if (path == NULL) return n_arch_prefs; //no prefs found
config_file = fopen(path, "r");
if(!config_file) return n_arch_prefs; //no prefs found