From 83487e78cb7ba4fc74d85cd8005b4d824535d93e Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Wed, 25 Jul 2012 13:51:19 +0200 Subject: [PATCH] skip empty packages arguments (gobject-introspection scanner can pass empty arguments to pkgconf) This improves compatibility with pkg-config --- main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.c b/main.c index 32926e0..c57af1a 100644 --- a/main.c +++ b/main.c @@ -689,6 +689,15 @@ main(int argc, char *argv[]) if (package == NULL) break; + while (isspace(package[0])) + package++; + + /* skip empty packages */ + if (package[0] == '\0') { + pkg_optind++; + continue; + } + if (argv[pkg_optind + 1] == NULL || !PKG_OPERATOR_CHAR(*(argv[pkg_optind + 1]))) { pkgq = pkg_queue_push(pkgq, package);