From 147fd807503df0d087f2a0508b4bedfb0870f259 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Fri, 13 Jan 2017 20:12:38 -0600 Subject: [PATCH] path: relocate system libdir/includedir if appropriate --- libpkgconf/path.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libpkgconf/path.c b/libpkgconf/path.c index 922f8fb..cb6c498 100644 --- a/libpkgconf/path.c +++ b/libpkgconf/path.c @@ -77,6 +77,8 @@ void pkgconf_path_add(const char *text, pkgconf_list_t *dirlist, bool filter) { pkgconf_path_t *node; + char path[PKGCONF_BUFSIZE]; + #ifdef PKGCONF_CACHE_INODES struct stat st; @@ -90,8 +92,12 @@ pkgconf_path_add(const char *text, pkgconf_list_t *dirlist, bool filter) return; #endif + pkgconf_strlcpy(path, text, sizeof path); + pkgconf_path_relocate(path, sizeof path); + node = calloc(sizeof(pkgconf_path_t), 1); - node->path = strdup(text); + node->path = strdup(path); + #ifdef PKGCONF_CACHE_INODES if (filter) { node->handle_path = (void *)(intptr_t) st.st_ino;