From 6473db4be8d78e4934959c9b71418de4e34886dc Mon Sep 17 00:00:00 2001 From: rillig Date: Thu, 31 Aug 2006 06:49:59 +0000 Subject: Made the shell word parser accept \$$ as a token. This avoids an internal error showing up in benchmarks/netio. --- pkgtools/pkglint/files/pkglint.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pkgtools') diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index d06c7fcee0e..5217dc23676 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.671 2006/08/30 05:41:19 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.672 2006/08/31 06:49:59 rillig Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -1813,7 +1813,8 @@ my $regex_shellword = qr"\s*( (?: '[^']*' # single quoted string | \"(?:\\.|[^\"\\])*\" # double quoted string | \`[^\`]*\` # backticks string - | \\. # any escaped character + | \\\$\$ # an escaped dollar sign + | \\[^\$] # other escaped characters | \$\{[^{}]+\} # make(1) variable | \$\([^()]+\) # make(1) variable, $(...) | \$[/\@<^] # special make(1) variables @@ -4023,7 +4024,7 @@ sub checkline_mk_shellword($$$) { $state = SWST_DQUOT; } elsif ($rest =~ s/^\`//) { $state = SWST_BACKT; - } elsif ($rest =~ s/^\\[ !"#'\(\)*;\\^{|}]//) { + } elsif ($rest =~ s/^\\(?:[ !"#'\(\)*;\\^{|}]|\$\$)//) { } elsif ($rest =~ s/^\$\$([0-9A-Z_a-z]+)// || $rest =~ s/^\$\$\{([0-9A-Z_a-z]+)\}//) { my ($shvarname) = ($1); -- cgit v1.2.3