diff --git a/libpkgconf/libpkgconf.h b/libpkgconf/libpkgconf.h index 8381b0e..0eb28d0 100644 --- a/libpkgconf/libpkgconf.h +++ b/libpkgconf/libpkgconf.h @@ -220,6 +220,7 @@ PKGCONF_API void pkgconf_client_dir_list_build(pkgconf_client_t *client, const p /* personality.c */ PKGCONF_API const pkgconf_cross_personality_t *pkgconf_cross_personality_default(void); +PKGCONF_API pkgconf_cross_personality_t *pkgconf_cross_personality_find(const char *triplet); #define PKGCONF_IS_MODULE_SEPARATOR(c) ((c) == ',' || isspace ((unsigned int)(c))) #define PKGCONF_IS_OPERATOR_CHAR(c) ((c) == '<' || (c) == '>' || (c) == '!' || (c) == '=') diff --git a/libpkgconf/personality.c b/libpkgconf/personality.c index c653ff3..11e6830 100644 --- a/libpkgconf/personality.c +++ b/libpkgconf/personality.c @@ -131,7 +131,7 @@ personality_fragment_func(pkgconf_cross_personality_t *p, const char *keyword, c (void) lineno; pkgconf_list_t *dest = (pkgconf_list_t *)((char *) p + offset); - pkgconf_fragment_parse(NULL, dest, NULL, value); + pkgconf_path_split(value, dest, false); } /* keep in alphabetical order! */ @@ -199,7 +199,8 @@ load_personality_with_path(const char *path, const char *triplet) return NULL; p = calloc(sizeof(pkgconf_cross_personality_t), 1); - p->name = strdup(triplet); + if (triplet != NULL) + p->name = strdup(triplet); pkgconf_parser_parse(f, p, personality_parser_ops, personality_warn_func, pathbuf); return p; @@ -222,13 +223,13 @@ pkgconf_cross_personality_find(const char *triplet) pkgconf_node_t *n; pkgconf_cross_personality_t *out = NULL; - if (!valid_triplet(triplet)) - return NULL; - out = load_personality_with_path(triplet, NULL); if (out != NULL) return out; + if (!valid_triplet(triplet)) + return NULL; + pkgconf_path_split(PERSONALITY_PATH, &plist, true); PKGCONF_FOREACH_LIST_ENTRY(plist.head, n)