summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrillig <rillig>2007-12-22 22:27:17 +0000
committerrillig <rillig>2007-12-22 22:27:17 +0000
commitf0e84e97adbf667dea31f7c715d99e7051923221 (patch)
tree74f487c6a3ac2a6d5445bfc8060f3b4ac6ada0ba
parentd077818a93671507e2f0815ab8022032e6809847 (diff)
downloadpkgsrc-f0e84e97adbf667dea31f7c715d99e7051923221.tar.gz
Prevent internal errors when one-letter variables are used. The warning
to disambiguate them is still printed. PR: 37593
-rw-r--r--pkgtools/pkglint/files/pkglint.pl5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 660e550aff9..d634f4d3cfb 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -1,5 +1,5 @@
#! @PERL@
-# $NetBSD: pkglint.pl,v 1.741 2007/12/22 11:15:52 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.742 2007/12/22 22:27:17 rillig Exp $
#
# pkglint - static analyzer and checker for pkgsrc packages
@@ -1785,6 +1785,7 @@ my $regex_shellword = qr"\s*(
| \`[^\`]*\` # backticks string
| \\\$\$ # an escaped dollar sign
| \\[^\$] # other escaped characters
+ | \$[\w_] # one-character make(1) variable
| \$\{[^{}]+\} # make(1) variable
| \$\([^()]+\) # make(1) variable, $(...)
| \$[/\@<^] # special make(1) variables
@@ -4223,7 +4224,7 @@ sub checkline_mk_shellword($$$) {
# which state we are currently.
} elsif ($rest =~ s/^\$\{(${regex_varname}|[\@])(:[^\{]+)?\}//
|| $rest =~ s/^\$\((${regex_varname}|[\@])(:[^\)]+)?\)//
- || $rest =~ s/^\$(\@)//) {
+ || $rest =~ s/^\$([\w\@])//) {
my ($varname, $mod) = ($1, $2);
if ($varname eq "\@") {