From 0e79b256555a01dd7c536e2211dfd98c91e0a2fd Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Thu, 7 Jul 2022 07:42:21 -0500 Subject: [PATCH] Fix .hamlib_settings path when home==null https://github.com/Hamlib/Hamlib/issues/985 --- src/settings.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/settings.c b/src/settings.c index a9a15d31e..be85e625b 100644 --- a/src/settings.c +++ b/src/settings.c @@ -997,11 +997,15 @@ HAMLIB_EXPORT(int) rig_settings_get_path(char *path, int pathlen) { snprintf(path, pathlen-1, "%s/.config/%s", home, SETTINGS_FILE); } - else + else if (home) { // we add a leading period to hide the file snprintf(path, pathlen-1, "%s/.%s", home, SETTINGS_FILE); } + else + { + snprintf(path, pathlen-1, ".%s", SETTINGS_FILE); + } rig_debug(RIG_DEBUG_TRACE, "%s: path=%s\n", __func__, path); return RIG_OK; }