main: filter out system dir fragments instead of skipping them when printing

pull/100/head
William Pitcock 2016-12-09 22:47:02 -06:00
parent 2b5d763e31
commit af63b799f1
1 changed files with 7 additions and 4 deletions

11
main.c
View File

@ -73,7 +73,7 @@ error_handler(const char *msg)
} }
static bool static bool
fragment_has_system_dir(pkgconf_fragment_t *frag) fragment_has_system_dir(const pkgconf_fragment_t *frag)
{ {
int check_flags = 0; int check_flags = 0;
pkgconf_list_t *check_paths = NULL; pkgconf_list_t *check_paths = NULL;
@ -101,9 +101,6 @@ fragment_has_system_dir(pkgconf_fragment_t *frag)
static void static void
print_fragment(pkgconf_fragment_t *frag) print_fragment(pkgconf_fragment_t *frag)
{ {
if (fragment_has_system_dir(frag))
return;
if (frag->type) if (frag->type)
printf("-%c%s ", frag->type, frag->data); printf("-%c%s ", frag->type, frag->data);
else else
@ -152,6 +149,9 @@ filter_cflags(const pkgconf_client_t *client, const pkgconf_fragment_t *frag, un
(void) client; (void) client;
(void) flags; (void) flags;
if (fragment_has_system_dir(frag))
return false;
if (frag->type == 'I') if (frag->type == 'I')
got_flags = PKG_CFLAGS_ONLY_I; got_flags = PKG_CFLAGS_ONLY_I;
else else
@ -167,6 +167,9 @@ filter_libs(const pkgconf_client_t *client, const pkgconf_fragment_t *frag, unsi
(void) client; (void) client;
(void) flags; (void) flags;
if (fragment_has_system_dir(frag))
return false;
switch (frag->type) switch (frag->type)
{ {
case 'L': got_flags = PKG_LIBS_ONLY_LDPATH; break; case 'L': got_flags = PKG_LIBS_ONLY_LDPATH; break;