forked from ariadne/pkgconf
Revert "pkgconf_pkg_parser_value_set(): fix code-path ordering bug."
This reverts commit 13fe4c8c58
.
master
parent
b602e33141
commit
b0802cb3d1
|
@ -305,11 +305,7 @@ pkgconf_pkg_parser_value_set(void *opaque, const size_t lineno, const char *keyw
|
|||
* which is broken when redefining the prefix. We try to outsmart the
|
||||
* file and rewrite any directory that starts with the same prefix.
|
||||
*/
|
||||
if (strcmp(keyword, pkg->owner->prefix_varname) || !(pkg->owner->flags & PKGCONF_PKG_PKGF_REDEFINE_PREFIX))
|
||||
{
|
||||
pkgconf_tuple_add(pkg->owner, &pkg->vars, keyword, value, true);
|
||||
}
|
||||
else if (pkg->owner->flags & PKGCONF_PKG_PKGF_REDEFINE_PREFIX && pkg->orig_prefix
|
||||
if (pkg->owner->flags & PKGCONF_PKG_PKGF_REDEFINE_PREFIX && pkg->orig_prefix
|
||||
&& is_path_prefix_equal(canonicalized_value, pkg->orig_prefix->value, strlen(pkg->orig_prefix->value)))
|
||||
{
|
||||
char newvalue[PKGCONF_ITEM_SIZE];
|
||||
|
@ -318,6 +314,8 @@ pkgconf_pkg_parser_value_set(void *opaque, const size_t lineno, const char *keyw
|
|||
pkgconf_strlcat(newvalue, canonicalized_value + strlen(pkg->orig_prefix->value), sizeof newvalue);
|
||||
pkgconf_tuple_add(pkg->owner, &pkg->vars, keyword, newvalue, false);
|
||||
}
|
||||
else if (strcmp(keyword, pkg->owner->prefix_varname) || !(pkg->owner->flags & PKGCONF_PKG_PKGF_REDEFINE_PREFIX))
|
||||
pkgconf_tuple_add(pkg->owner, &pkg->vars, keyword, value, true);
|
||||
else
|
||||
{
|
||||
char pathbuf[PKGCONF_ITEM_SIZE];
|
||||
|
@ -327,7 +325,7 @@ pkgconf_pkg_parser_value_set(void *opaque, const size_t lineno, const char *keyw
|
|||
{
|
||||
char *prefix_value = convert_path_to_value(relvalue);
|
||||
pkg->orig_prefix = pkgconf_tuple_add(pkg->owner, &pkg->vars, "orig_prefix", canonicalized_value, true);
|
||||
pkgconf_tuple_add_global(pkg->owner, keyword, prefix_value);
|
||||
pkg->prefix = pkgconf_tuple_add(pkg->owner, &pkg->vars, keyword, prefix_value, false);
|
||||
free(prefix_value);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue