libpkgconf: client: ensure PKG_CONFIG_LIBDIR being empty overrides the default search paths

closes #25
feature/tap-sh
William Pitcock 2019-03-23 22:17:04 -05:00
parent 45eae2039e
commit ba1f48e48e
2 changed files with 18 additions and 2 deletions

3
NEWS
View File

@ -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:
----------------------------

View File

@ -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);
}
}
/*