Do not parse the global variables
This fixes an incompatibility with pkg-confing 0.29 Found by Thomas Klausner <wiz@NetBSD.org> when building gupnp-igd-0.2.3 with introspection supportpull/92/head
parent
32bd6bd700
commit
1fe91b914c
|
@ -182,7 +182,7 @@ void pkgconf_fragment_free(pkgconf_list_t *list);
|
|||
char *pkgconf_fgetline(char *line, size_t size, FILE *stream);
|
||||
|
||||
/* tuple.c */
|
||||
pkgconf_tuple_t *pkgconf_tuple_add(pkgconf_list_t *parent, const char *key, const char *value);
|
||||
pkgconf_tuple_t *pkgconf_tuple_add(pkgconf_list_t *parent, const char *key, const char *value, bool parse);
|
||||
char *pkgconf_tuple_find(pkgconf_list_t *list, const char *key);
|
||||
char *pkgconf_tuple_parse(pkgconf_list_t *list, const char *value);
|
||||
void pkgconf_tuple_free(pkgconf_list_t *list);
|
||||
|
|
|
@ -208,7 +208,7 @@ pkgconf_pkg_new_from_file(const char *filename, FILE *f, unsigned int flags)
|
|||
|
||||
pkg = calloc(sizeof(pkgconf_pkg_t), 1);
|
||||
pkg->filename = strdup(filename);
|
||||
pkgconf_tuple_add(&pkg->vars, "pcfiledir", pkg_get_parent_dir(pkg));
|
||||
pkgconf_tuple_add(&pkg->vars, "pcfiledir", pkg_get_parent_dir(pkg), true);
|
||||
|
||||
/* make module id */
|
||||
if ((idptr = strrchr(pkg->filename, PKG_DIR_SEP_S)) != NULL)
|
||||
|
@ -273,7 +273,7 @@ pkgconf_pkg_new_from_file(const char *filename, FILE *f, unsigned int flags)
|
|||
pkgconf_dependency_parse(pkg, &pkg->conflicts, value);
|
||||
break;
|
||||
case '=':
|
||||
pkgconf_tuple_add(&pkg->vars, key, value);
|
||||
pkgconf_tuple_add(&pkg->vars, key, value, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -20,7 +20,7 @@ static pkgconf_list_t pkg_global_var = PKGCONF_LIST_INITIALIZER;
|
|||
void
|
||||
pkgconf_tuple_add_global(const char *key, const char *value)
|
||||
{
|
||||
pkgconf_tuple_add(&pkg_global_var, key, value);
|
||||
pkgconf_tuple_add(&pkg_global_var, key, value, false);
|
||||
}
|
||||
|
||||
char *
|
||||
|
@ -62,12 +62,15 @@ out:
|
|||
}
|
||||
|
||||
pkgconf_tuple_t *
|
||||
pkgconf_tuple_add(pkgconf_list_t *list, const char *key, const char *value)
|
||||
pkgconf_tuple_add(pkgconf_list_t *list, const char *key, const char *value, bool parse)
|
||||
{
|
||||
pkgconf_tuple_t *tuple = calloc(sizeof(pkgconf_tuple_t), 1);
|
||||
|
||||
tuple->key = strdup(key);
|
||||
if (parse)
|
||||
tuple->value = pkgconf_tuple_parse(list, value);
|
||||
else
|
||||
tuple->value = strdup(value);
|
||||
|
||||
pkgconf_node_insert(&tuple->iter, tuple, list);
|
||||
|
||||
|
@ -126,6 +129,14 @@ pkgconf_tuple_parse(pkgconf_list_t *vars, const char *value)
|
|||
}
|
||||
|
||||
ptr += (pptr - ptr);
|
||||
kv = pkgconf_tuple_find_global(varname);
|
||||
if (kv != NULL)
|
||||
{
|
||||
strncpy(bptr, kv, PKGCONF_BUFSIZE - (bptr - buf));
|
||||
bptr += strlen(kv);
|
||||
}
|
||||
else
|
||||
{
|
||||
kv = pkgconf_tuple_find(vars, varname);
|
||||
|
||||
if (kv != NULL)
|
||||
|
@ -139,6 +150,7 @@ pkgconf_tuple_parse(pkgconf_list_t *vars, const char *value)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*bptr = '\0';
|
||||
|
||||
|
|
Loading…
Reference in New Issue