diff options
author | Johnathan Corgan | 2012-03-22 15:01:38 -0700 |
---|---|---|
committer | Johnathan Corgan | 2012-03-22 15:01:38 -0700 |
commit | 69c9100b8221f8b485e3acc07e99d5f410909d5e (patch) | |
tree | 15615130be1619dc22a1d8769233b4ed056c50df /volk/lib/volk_prefs.c | |
parent | 314916c9f36406205c6bd7c72da4f596224a5032 (diff) | |
parent | 116f82343080091df0c3c7efb61c202cadf30f3b (diff) | |
download | gnuradio-69c9100b8221f8b485e3acc07e99d5f410909d5e.tar.gz gnuradio-69c9100b8221f8b485e3acc07e99d5f410909d5e.tar.bz2 gnuradio-69c9100b8221f8b485e3acc07e99d5f410909d5e.zip |
Merge branch 'maint'
Diffstat (limited to 'volk/lib/volk_prefs.c')
-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 |