diff options
author | Dan Nicholson <dbn.lists@gmail.com> | 2014-02-10 08:04:31 -0800 |
---|---|---|
committer | Dan Nicholson <nicholson@endlessm.com> | 2014-12-09 05:24:43 -0800 |
commit | 9294307b213c157db991d838654e7fef6842b1de (patch) | |
tree | b555cb72322127f821cad2264c1bbeaca18a5acf /parse.c | |
parent | 30437b47c81590bf8b9efffd19f9a42e6112b9cb (diff) | |
download | pkg-config-9294307b213c157db991d838654e7fef6842b1de.tar.gz |
Handle pcfiledir variable like normal variable
Rather than responding to the pcfiledir variable specially, store it
in the hash table with all the other package specific variables. This
does result in pcfiledir showing up in the --print-variables output.
Diffstat (limited to 'parse.c')
-rw-r--r-- | parse.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -990,9 +990,6 @@ parse_line (Package *pkg, const char *untrimmed, const char *path, ++p; while (*p && isspace ((guchar)*p)) ++p; - - if (pkg->vars == NULL) - pkg->vars = g_hash_table_new (g_str_hash, g_str_equal); if (define_prefix && strcmp (tag, prefix_variable) == 0) { @@ -1114,7 +1111,13 @@ parse_package_file (const char *path, gboolean ignore_requires, debug_spew ("No pcfiledir determined for package\n"); pkg->pcfiledir = g_strdup ("???????"); } - + + if (pkg->vars == NULL) + pkg->vars = g_hash_table_new (g_str_hash, g_str_equal); + + /* Variable storing directory of pc file */ + g_hash_table_insert (pkg->vars, "pcfiledir", pkg->pcfiledir); + str = g_string_new (""); while (read_one_line (f, str)) |