diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 7934eccee..317b9a5eb 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -3261,6 +3261,8 @@ rigerror2 HAMLIB_PARAMS((int errnum)); extern HAMLIB_EXPORT(int) rig_setting2idx HAMLIB_PARAMS((setting_t s)); +#define HAMLIB_SETTINGS_FILE "hamlib_settings" + extern HAMLIB_EXPORT(setting_t) rig_idx2setting(int i); /* diff --git a/src/settings.c b/src/settings.c index 521bc4a40..8745cd9f1 100644 --- a/src/settings.c +++ b/src/settings.c @@ -1004,20 +1004,20 @@ HAMLIB_EXPORT(int) rig_settings_get_path(char *path, int pathlen) snprintf(path, pathlen, "%s/.config", home); if (xdgpath) { - snprintf(path, pathlen-1, "%s/%s/%s", xdgpath, cwd, SETTINGS_FILE); + snprintf(path, pathlen-1, "%s/%s/%s", xdgpath, cwd, HAMLIB_SETTINGS_FILE); } else if (home && access(path, F_OK) != -1) { - snprintf(path, pathlen-1, "%s/.config/%s", home, SETTINGS_FILE); + snprintf(path, pathlen-1, "%s/.config/%s", home, HAMLIB_SETTINGS_FILE); } else if (home) { // we add a leading period to hide the file - snprintf(path, pathlen-1, "%s/.%s", home, SETTINGS_FILE); + snprintf(path, pathlen-1, "%s/.%s", home, HAMLIB_SETTINGS_FILE); } else { - snprintf(path, pathlen-1, ".%s", SETTINGS_FILE); + snprintf(path, pathlen-1, ".%s", HAMLIB_SETTINGS_FILE); } rig_debug(RIG_DEBUG_TRACE, "%s: path=%s\n", __func__, path); return RIG_OK;