diff options
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 34161f10664..8c220896763 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.704 2007/03/24 05:36:20 schmonz Exp $ +# $NetBSD: pkglint.pl,v 1.705 2007/04/15 22:58:49 rillig Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -4171,6 +4171,24 @@ sub checkline_mk_shellword($$$) { checkline_mk_varuse($line, $varname, defined($mod) ? $mod : "", $ctx); } + # The syntax of the variable modifiers can get quite + # hairy. In lack of motivation, we just skip anything + # complicated, hoping that at least the braces are + # balanced. + } elsif ($rest =~ s/^\$\{//) { + my $braces = 1; + while ($rest ne "" && $braces > 0) { + if ($rest =~ s/^\}//) { + $braces--; + } elsif ($rest =~ s/^\{//) { + $braces++; + } elsif ($rest =~ s/^[^{}]+//) { + # Nothing to do here. + } else { + last; + } + } + } elsif ($state == SWST_PLAIN) { if ($rest =~ s/^[!#\%&\(\)*+,\-.\/0-9:;<=>?\@A-Z\[\]^_a-z{|}~]+//) { } elsif ($rest =~ s/^\'//) { |