From e70b536ea35a496b85dba65221d4b2145022f340 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Tue, 26 May 2020 11:01:46 -0600 Subject: [PATCH] libpkgconf: pkg: when generating a search path, use the correct path separator Before, this could result in generated paths like C:\foo\pkgconfig/bar.pc on Windows. --- libpkgconf/pkg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpkgconf/pkg.c b/libpkgconf/pkg.c index b0c390b..808b70f 100644 --- a/libpkgconf/pkg.c +++ b/libpkgconf/pkg.c @@ -531,8 +531,8 @@ pkgconf_pkg_try_specific_path(pkgconf_client_t *client, const char *path, const PKGCONF_TRACE(client, "trying path: %s for %s", path, name); - snprintf(locbuf, sizeof locbuf, "%s/%s" PKG_CONFIG_EXT, path, name); - snprintf(uninst_locbuf, sizeof uninst_locbuf, "%s/%s-uninstalled" PKG_CONFIG_EXT, path, name); + snprintf(locbuf, sizeof locbuf, "%s%c%s" PKG_CONFIG_EXT, path, PKG_DIR_SEP_S, name); + snprintf(uninst_locbuf, sizeof uninst_locbuf, "%s%c%s-uninstalled" PKG_CONFIG_EXT, path, PKG_DIR_SEP_S, name); if (!(client->flags & PKGCONF_PKG_PKGF_NO_UNINSTALLED) && (f = fopen(uninst_locbuf, "r")) != NULL) {