Index: trunk/src/hid_init.c =================================================================== --- trunk/src/hid_init.c (revision 5854) +++ trunk/src/hid_init.c (revision 5855) @@ -25,10 +25,11 @@ int pcb_pixel_slop = 1; -static void hid_load_dir(char *dirname) +static int hid_load_dir(char *dirname) { DIR *dir; struct dirent *de; + int count = 0; dir = opendir(dirname); if (!dir) { @@ -78,6 +79,7 @@ else uninit = NULL; pcb_plugin_register(basename, path, so, 1, uninit); + count++; free(symname); } else @@ -93,6 +95,7 @@ void pcb_hid_init() { + int found; pcb_hid_actions_init(); /* Setup a "nogui" default HID */ @@ -99,14 +102,16 @@ pcb_gui = pcb_hid_nogui_get_hid(); #warning TODO: make this configurable - hid_load_dir(pcb_concat(conf_core.rc.path.exec_prefix, PCB_DIR_SEPARATOR_S, "lib", + found = hid_load_dir(pcb_concat(conf_core.rc.path.exec_prefix, PCB_DIR_SEPARATOR_S, "lib", PCB_DIR_SEPARATOR_S, "pcb-rnd", PCB_DIR_SEPARATOR_S, "plugins", PCB_DIR_SEPARATOR_S, HOST, NULL)); - hid_load_dir(pcb_concat(conf_core.rc.path.exec_prefix, PCB_DIR_SEPARATOR_S, "lib", + found += hid_load_dir(pcb_concat(conf_core.rc.path.exec_prefix, PCB_DIR_SEPARATOR_S, "lib", PCB_DIR_SEPARATOR_S, "pcb-rnd", PCB_DIR_SEPARATOR_S, "plugins", NULL)); - /* hardwired libdir, just in case exec-prefix goes wrong (e.g. linstall) */ - hid_load_dir(pcb_concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S, "plugins", PCB_DIR_SEPARATOR_S, HOST, NULL)); - hid_load_dir(pcb_concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S, "plugins", NULL)); + if (found == 0) { + /* hardwired libdir, just in case exec-prefix goes wrong (e.g. linstall) */ + hid_load_dir(pcb_concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S, "plugins", PCB_DIR_SEPARATOR_S, HOST, NULL)); + hid_load_dir(pcb_concat(PCBLIBDIR, PCB_DIR_SEPARATOR_S, "plugins", NULL)); + } /* conf_core.rc.path.home is set by the conf_core immediately on startup */ if (conf_core.rc.path.home != NULL) {