skip empty packages arguments

(gobject-introspection scanner can pass empty arguments to pkgconf)
This improves compatibility with pkg-config
feature/tap-sh
Baptiste Daroussin 2012-07-25 13:51:19 +02:00
parent f7496747a5
commit 83487e78cb
1 changed files with 9 additions and 0 deletions

9
main.c
View File

@ -689,6 +689,15 @@ main(int argc, char *argv[])
if (package == NULL) if (package == NULL)
break; 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]))) if (argv[pkg_optind + 1] == NULL || !PKG_OPERATOR_CHAR(*(argv[pkg_optind + 1])))
{ {
pkgq = pkg_queue_push(pkgq, package); pkgq = pkg_queue_push(pkgq, package);