From 06bcbc7a504a41612e766b7c791cd8a788b24cfa Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 13 Sep 2017 12:24:44 +0300 Subject: Add support for PKGCONF_PKG_PKGF_SIMPLIFY_ERRORS flag --- libpkgconf/client.c | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) (limited to 'libpkgconf/client.c') diff --git a/libpkgconf/client.c b/libpkgconf/client.c index bcb6ae8..6529dbd 100644 --- a/libpkgconf/client.c +++ b/libpkgconf/client.c @@ -141,12 +141,11 @@ pkgconf_client_deinit(pkgconf_client_t *client) pkgconf_path_free(&client->dir_list); pkgconf_cache_free(client); - /* - * Added to the original leaking code (reported issue #130). - */ - pkgconf_path_free(&client->filter_libdirs); - pkgconf_path_free(&client->filter_includedirs); - + /* + * Fix the leak (issue #130 is reported). + */ + pkgconf_path_free(&client->filter_libdirs); + pkgconf_path_free(&client->filter_includedirs); } /* @@ -326,23 +325,17 @@ pkgconf_trace(const pkgconf_client_t *client, const char *filename, size_t linen size_t len; va_list va; - // Workaround MinGW bug which doesn't recognize 'z' length modifier - // (despite the presence of -std=C99 option) which leads to crash. - // - // This indeed is an issue with an outdated Windows run-time - // (msvcrt.dll) where MinGW delegates the function call. The modifier - // isn't mentioned in the documentation for Visual Studio 2015, but is - // for the later one. - // - // Note that the issue is already reported to pkgconf developers - // (issue #125) and hopefully will be workarounded. - // - // The original line: - // - // len = snprintf(errbuf, sizeof errbuf, "%s:%zu [%s]: ", filename, lineno, funcname); - // + /* + * Workaround MinGW bug which doesn't recognize 'z' length modifier (despite + * the presence of -std=C99 option) which leads to crash (issue #125 is + * reported). + * + * This indeed is an issue with an outdated Windows run-time (msvcrt.dll) + * where MinGW delegates the function call. The modifier isn't mentioned in + * the documentation for Visual Studio 2015, but is for the later one. + */ len = snprintf(errbuf, sizeof errbuf, "%s:%lu [%s]: ", - filename, (unsigned long)lineno, funcname); + filename, (unsigned long)lineno, funcname); va_start(va, format); vsnprintf(errbuf + len, sizeof(errbuf) - len, format, va); -- cgit v1.1