=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/pkg-config/pkg-config,v retrieving revision 1.85 retrieving revision 1.86 diff -c -r1.85 -r1.86 *** src/usr.bin/pkg-config/pkg-config 2014/11/17 22:16:23 1.85 --- src/usr.bin/pkg-config/pkg-config 2015/10/11 11:48:46 1.86 *************** *** 1,5 **** #!/usr/bin/perl ! # $OpenBSD: pkg-config,v 1.85 2014/11/17 22:16:23 jca Exp $ # $CSK: pkgconfig.pl,v 1.39 2006/11/27 16:26:20 ckuethe Exp $ # Copyright (c) 2006 Chris Kuethe --- 1,5 ---- #!/usr/bin/perl ! # $OpenBSD: pkg-config,v 1.86 2015/10/11 11:48:46 jasper Exp $ # $CSK: pkgconfig.pl,v 1.39 2006/11/27 16:26:20 ckuethe Exp $ # Copyright (c) 2006 Chris Kuethe *************** *** 161,168 **** exit 1; } while (@ARGV){ ! my $p = shift @ARGV; my $op = undef; my $v = undef; if (@ARGV >= 2 && $ARGV[0] =~ /^[<=>!]+$/ && --- 161,184 ---- exit 1; } + # Return the next module from @ARGV, if it turns out to be a comma separated + # module list, take the first one and put the rest back to the front. + sub get_next_module { + my $module = shift @ARGV; + my $m; + if ($module =~ m/,/) { + my @ms = split(/,/, $module); + $m = shift @ms; + unshift(@ARGV, @ms) if (scalar(@ms) > 0); + } else { + return $module; + } + + return $m; + } + while (@ARGV){ ! my $p = get_next_module(); my $op = undef; my $v = undef; if (@ARGV >= 2 && $ARGV[0] =~ /^[<=>!]+$/ &&