diff options
author | Tom Rondeau | 2012-03-27 21:46:48 -0400 |
---|---|---|
committer | Tom Rondeau | 2012-03-27 21:46:48 -0400 |
commit | 8bfb47dd8fb661039bdfdc475047e6f983f11270 (patch) | |
tree | 448402699fabea713d3f54b35e7733617d273ab3 /volk/lib | |
parent | da09d2b000606b55f564bc6adaa945968d6c3e72 (diff) | |
parent | 79e341d9064b8e44c2d1900cb34ddb51deebb559 (diff) | |
download | gnuradio-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.c | 10 |
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 |