diff --git a/NEWS b/NEWS index fa1128e..c4396e4 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,9 @@ Changes from 1.6.0 to 1.6.1: * Bug fixes: - Fixed an issue where a personality may not be properly selected due to argv[0] containing a full path. + - Fixed a regression where having an empty PKG_CONFIG_LIBDIR + environment variable would not eliminate the default search + paths. Changes from 1.5.4 to 1.6.0: ---------------------------- diff --git a/libpkgconf/client.c b/libpkgconf/client.c index f4155b3..3dde93d 100644 --- a/libpkgconf/client.c +++ b/libpkgconf/client.c @@ -62,8 +62,21 @@ pkgconf_client_dir_list_build(pkgconf_client_t *client, const pkgconf_cross_pers { pkgconf_path_build_from_environ("PKG_CONFIG_PATH", NULL, &client->dir_list, true); - if (!(client->flags & PKGCONF_PKG_PKGF_ENV_ONLY) && (pkgconf_path_build_from_environ("PKG_CONFIG_LIBDIR", NULL, &client->dir_list, true)) < 1) - pkgconf_path_copy_list(&client->dir_list, &personality->dir_list); + if (!(client->flags & PKGCONF_PKG_PKGF_ENV_ONLY)) + { + pkgconf_list_t dir_list = PKGCONF_LIST_INITIALIZER; + const pkgconf_list_t *prepend_list = &personality->dir_list; + + if (getenv("PKG_CONFIG_LIBDIR") != NULL) + { + /* PKG_CONFIG_LIBDIR= should empty the search path entirely. */ + (void) pkgconf_path_build_from_environ("PKG_CONFIG_LIBDIR", NULL, &dir_list, true); + prepend_list = &dir_list; + } + + pkgconf_path_copy_list(&client->dir_list, prepend_list); + pkgconf_path_free(&dir_list); + } } /*