diff options
author | rillig <rillig@pkgsrc.org> | 2022-08-14 12:42:38 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2022-08-14 12:42:38 +0000 |
commit | e59cbf9a3495a490f3d486851d942032fe0665c0 (patch) | |
tree | 91c7f0bca100ac74ff68ea5951ae066dd088da26 /pkgtools/lintpkgsrc | |
parent | e08244ef50a4f7f25d5e97ad12e28c9b240f1ca3 (diff) | |
download | pkgsrc-e59cbf9a3495a490f3d486851d942032fe0665c0.tar.gz |
lintpkgsrc: fix handling of 0 in brace expansions
Diffstat (limited to 'pkgtools/lintpkgsrc')
-rwxr-xr-x | pkgtools/lintpkgsrc/files/lintpkgsrc.pl | 5 | ||||
-rw-r--r-- | pkgtools/lintpkgsrc/files/t/glob.t | 8 |
2 files changed, 5 insertions, 8 deletions
diff --git a/pkgtools/lintpkgsrc/files/lintpkgsrc.pl b/pkgtools/lintpkgsrc/files/lintpkgsrc.pl index 9fb6db2a69a..790ffe9fa96 100755 --- a/pkgtools/lintpkgsrc/files/lintpkgsrc.pl +++ b/pkgtools/lintpkgsrc/files/lintpkgsrc.pl @@ -1,5 +1,5 @@ #!@PERL5@ -# $NetBSD: lintpkgsrc.pl,v 1.92 2022/08/14 12:40:43 rillig Exp $ +# $NetBSD: lintpkgsrc.pl,v 1.93 2022/08/14 12:42:38 rillig Exp $ # Written by David Brownlee <abs@netbsd.org>. # @@ -250,8 +250,7 @@ sub expand_braces($str) { my @todo = ($str); my @expanded; - # FIXME: see test_expand_braces. - while ($str = shift @todo) { + while (defined($str = shift @todo)) { # FIXME: see test_expand_braces. if ($str =~ /(.*) \{ ([^{}]+) } (.*)/x) { # FIXME: see test_expand_braces. diff --git a/pkgtools/lintpkgsrc/files/t/glob.t b/pkgtools/lintpkgsrc/files/t/glob.t index b5acfffb817..bc104275b40 100644 --- a/pkgtools/lintpkgsrc/files/t/glob.t +++ b/pkgtools/lintpkgsrc/files/t/glob.t @@ -1,4 +1,4 @@ -# $NetBSD: glob.t,v 1.9 2022/08/14 12:40:43 rillig Exp $ +# $NetBSD: glob.t,v 1.10 2022/08/14 12:42:38 rillig Exp $ # # Tests for file globbing and matching. @@ -66,10 +66,8 @@ sub test_expand_braces() { # FIXME: '<>' is missing. [ '<{opt,}>', '<opt>' ], [ '<{,opt}>', '<>', '<opt>' ], - # FIXME: '0', '1', '2' are missing. - [ '{0,1,2}', ], - # FIXME: '0' is missing. - [ '{2,1,0}', '2', '1' ], + [ '{0,1,2}', '0', '1', '2' ], + [ '{2,1,0}', '2', '1', '0' ], ); foreach my $example (@examples) { |