Index: trunk/src/hid_cfg.c =================================================================== --- trunk/src/hid_cfg.c (revision 1477) +++ trunk/src/hid_cfg.c (revision 1478) @@ -32,6 +32,7 @@ #include "hid_actions.h" #include "hid_cfg.h" #include "error.h" +#include "paths.h" char hid_cfg_error_shared[1024]; @@ -125,7 +126,7 @@ return n->data.text.value; } -hid_cfg_t *hid_cfg_load(const char *hidname, const char *embedded_fallback) +hid_cfg_t *hid_cfg_load(const char *hidname, int exact_fn, const char *embedded_fallback) { lht_doc_t *doc; hid_cfg_t *hr; @@ -133,7 +134,19 @@ //static const char *pcbmenu_paths_in[] = { "gpcb-menu.res", "gpcb-menu.res", PCBSHAREDIR "/gpcb-menu.res", NULL }; char *hidfn = strdup(hidname); /* TODO: search for the file */ - doc = hid_cfg_load_lht(hidfn); + if (!exact_fn) { + static const char *hid_cfg_paths_in[] = { ".", PCBSHAREDIR "/", NULL }; + char **paths = NULL; + + resolve_all_paths(hid_cfg_paths_in, paths); + for(doc = NULL; doc == NULL;) { + + } + free(paths); + } + else + doc = hid_cfg_load_lht(hidfn); + if (doc == NULL) doc = hid_cfg_load_str(embedded_fallback); if (doc == NULL) Index: trunk/src/hid_cfg.h =================================================================== --- trunk/src/hid_cfg.h (revision 1477) +++ trunk/src/hid_cfg.h (revision 1478) @@ -36,7 +36,7 @@ /* Search and load the menu res for hidname; if not found, and embedded_fallback is not NULL, parse that string instead. Returns NULL on error */ -hid_cfg_t *hid_cfg_load(const char *hidname, const char *embedded_fallback); +hid_cfg_t *hid_cfg_load(const char *hidname, int exact_fn, const char *embedded_fallback); /* Generic, low level lihata loader */ lht_doc_t *hid_cfg_load_lht(const char *filename); Index: trunk/src_plugins/hid_gtk/gui-top-window.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-top-window.c (revision 1477) +++ trunk/src_plugins/hid_gtk/gui-top-window.c (revision 1478) @@ -1759,7 +1759,7 @@ extern const char *hid_gtk_menu_default; - ghid_cfg = hid_cfg_load("gtk", hid_gtk_menu_default); + ghid_cfg = hid_cfg_load("gtk", 0, hid_gtk_menu_default); if (ghid_cfg == NULL) { Message("FATAL: can't load the gtk menu res either from file or from hardwired default."); abort(); Index: trunk/src_plugins/hid_lesstif/menu.c =================================================================== --- trunk/src_plugins/hid_lesstif/menu.c (revision 1477) +++ trunk/src_plugins/hid_lesstif/menu.c (revision 1478) @@ -996,7 +996,7 @@ extern const char *lesstif_menu_default; - r = hid_cfg_load("lesstif", lesstif_menu_default); + r = hid_cfg_load("lesstif", 0, lesstif_menu_default); if (r == NULL) { Message("FATAL: can't load the lesstif menu res either from file or from hardwired default."); abort();