diff --git a/cli/bomtool/main.c b/cli/bomtool/main.c index 8c1128c..e253b5f 100644 --- a/cli/bomtool/main.c +++ b/cli/bomtool/main.c @@ -33,6 +33,14 @@ static size_t maximum_package_count = 0; static int maximum_traverse_depth = 2000; static FILE *error_msgout = NULL; +static const char * +environ_lookup_handler(const pkgconf_client_t *client, const char *key) +{ + (void) client; + + return getenv(key); +} + static bool error_handler(const char *msg, const pkgconf_client_t *client, void *data) { @@ -285,7 +293,7 @@ main(int argc, char *argv[]) } } - pkgconf_client_init(&pkg_client, error_handler, NULL, personality, NULL); + pkgconf_client_init(&pkg_client, error_handler, NULL, personality, NULL, environ_lookup_handler); /* we have determined what features we want most likely. in some cases, we override later. */ pkgconf_client_set_flags(&pkg_client, want_client_flags); diff --git a/cli/main.c b/cli/main.c index 77c1c8a..9394304 100644 --- a/cli/main.c +++ b/cli/main.c @@ -19,6 +19,14 @@ #include "getopt_long.h" #include "core.h" +static const char * +environ_lookup_handler(const pkgconf_client_t *client, const char *key) +{ + (void) client; + + return getenv(key); +} + static bool error_handler(const char *msg, const pkgconf_client_t *client, void *data) { @@ -411,7 +419,7 @@ main(int argc, char *argv[]) #endif /* now, bring up the client. settings are preserved since the client is prealloced */ - pkgconf_client_init(&state.pkg_client, error_handler, &state, state.personality, &state); + pkgconf_client_init(&state.pkg_client, error_handler, &state, state.personality, &state, environ_lookup_handler); #ifndef PKGCONF_LITE if (getenv("PKG_CONFIG_MSVC_SYNTAX") != NULL) diff --git a/cli/spdxtool/main.c b/cli/spdxtool/main.c index 004544d..cbaa353 100644 --- a/cli/spdxtool/main.c +++ b/cli/spdxtool/main.c @@ -33,6 +33,14 @@ static size_t maximum_package_count = 0; // static int maximum_traverse_depth = 2000; static FILE *error_msgout = NULL; +static const char * +environ_lookup_handler(const pkgconf_client_t *client, const char *key) +{ + (void) client; + + return getenv(key); +} + static bool error_handler(const char *msg, const pkgconf_client_t *client, void *data) { @@ -263,7 +271,7 @@ main(int argc, char *argv[]) } } - pkgconf_client_init(&pkg_client, error_handler, NULL, personality, NULL); + pkgconf_client_init(&pkg_client, error_handler, NULL, personality, NULL, environ_lookup_handler); /* we have determined what features we want most likely. in some cases, we override later. */ pkgconf_client_set_flags(&pkg_client, want_client_flags);