Index: trunk/src/conf.c =================================================================== --- trunk/src/conf.c (revision 2243) +++ trunk/src/conf.c (revision 2244) @@ -88,11 +88,14 @@ d = hid_cfg_load_lht(fn); if (d == NULL) { FILE *f; - f = fopen(fn, "r"); + char *efn; + resolve_path(fn, &efn, 0); + f = fopen(efn, "r"); if (f != NULL) { /* warn only if the file is there - missing file is normal */ - Message("error: failed to load lht config: %s\n", fn); + Message("error: failed to load lht config: %s\n", efn); fclose(f); } + free(efn); return -1; } @@ -300,6 +303,8 @@ base = 16; } l = strtol(text, &end, base); + while(isspace(*end)) + end++; if (*end == '\0') { dst->integer[idx] = l; return 0; Index: trunk/src/hid_cfg.c =================================================================== --- trunk/src/hid_cfg.c (revision 2243) +++ trunk/src/hid_cfg.c (revision 2244) @@ -152,12 +152,17 @@ FILE *f; lht_doc_t *doc; int error = 0; + char *efn; - f = fopen(filename, "r"); - if (f == NULL) + resolve_path(filename, &efn, 0); + + f = fopen(efn, "r"); + if (f == NULL) { + free(efn); return NULL; + } doc = lht_dom_init(); - lht_dom_loc_newfile(doc, filename); + lht_dom_loc_newfile(doc, efn); while(!(feof(f))) { lht_err_t err; @@ -165,7 +170,7 @@ err = lht_dom_parser_char(doc, c); if (err != LHTE_SUCCESS) { if (err != LHTE_STOP) { - error = hid_cfg_load_error(doc, filename, err); + error = hid_cfg_load_error(doc, efn, err); break; } break; /* error or stop, do not read anymore (would get LHTE_STOP without any processing all the time) */ @@ -178,6 +183,7 @@ } fclose(f); + free(efn); return doc; }