forked from ariadne/pkgconf
tuple: use ${pc_sysrootdir} instead of client->sysroot_dir where relevant
parent
7fa632a658
commit
72e429ae70
|
@ -330,15 +330,19 @@ pkgconf_tuple_parse(const pkgconf_client_t *client, pkgconf_list_t *vars, const
|
||||||
*
|
*
|
||||||
* Finally, we call pkgconf_path_relocate() to clean the path of spurious elements.
|
* Finally, we call pkgconf_path_relocate() to clean the path of spurious elements.
|
||||||
*/
|
*/
|
||||||
|
const char *sysroot_dir = pkgconf_tuple_find(client, vars, "pc_sysrootdir");
|
||||||
|
if (sysroot_dir == NULL)
|
||||||
|
sysroot_dir = client->sysroot_dir;
|
||||||
|
|
||||||
if (*buf == '/' &&
|
if (*buf == '/' &&
|
||||||
client->sysroot_dir != NULL &&
|
sysroot_dir != NULL &&
|
||||||
strcmp(client->sysroot_dir, "/") != 0 &&
|
strcmp(sysroot_dir, "/") != 0 &&
|
||||||
strlen(buf) > strlen(client->sysroot_dir) &&
|
strlen(buf) > strlen(sysroot_dir) &&
|
||||||
strstr(buf + strlen(client->sysroot_dir), client->sysroot_dir) != NULL)
|
strstr(buf + strlen(sysroot_dir), sysroot_dir) != NULL)
|
||||||
{
|
{
|
||||||
char cleanpath[PKGCONF_ITEM_SIZE];
|
char cleanpath[PKGCONF_ITEM_SIZE];
|
||||||
|
|
||||||
pkgconf_strlcpy(cleanpath, buf + strlen(client->sysroot_dir), sizeof cleanpath);
|
pkgconf_strlcpy(cleanpath, buf + strlen(sysroot_dir), sizeof cleanpath);
|
||||||
pkgconf_path_relocate(cleanpath, sizeof cleanpath);
|
pkgconf_path_relocate(cleanpath, sizeof cleanpath);
|
||||||
|
|
||||||
return strdup(cleanpath);
|
return strdup(cleanpath);
|
||||||
|
|
Loading…
Reference in New Issue