summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2006-08-04 18:32:41 +0000
committerrillig <rillig@pkgsrc.org>2006-08-04 18:32:41 +0000
commit63011994c34389350c0c8fb0fb965fce7b6a5652 (patch)
tree5f790fe07857b4eb59982596e1b3ed05a7093803 /pkgtools
parent1032d6cd56cbec61ff1aab7a48db9d5bbc29b160 (diff)
downloadpkgsrc-63011994c34389350c0c8fb0fb965fce7b6a5652.tar.gz
Added more code to the shell word parser so that it can parse variables,
in double quotes or not, inside backticks.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/files/pkglint.pl12
1 files changed, 9 insertions, 3 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 5d2ee18e23c..b6e0f1a225a 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -1,5 +1,5 @@
#! @PERL@
-# $NetBSD: pkglint.pl,v 1.668 2006/08/01 08:58:49 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.669 2006/08/04 18:32:41 rillig Exp $
#
# pkglint - static analyzer and checker for pkgsrc packages
@@ -4093,12 +4093,11 @@ sub checkline_mk_shellword($$$) {
} elsif ($rest =~ s/^\\//) {
$line->log_warning("Backslashes should be doubled inside backticks.");
} elsif ($rest =~ s/^\$\$\{([0-9A-Za-z_]+)\}//
- || $rest =~ s/^\$\$([0-9A-Za-z_]+)//) {
+ || $rest =~ s/^\$\$([0-9A-Z_a-z]+|\$\$|[!#?\@])//) {
my ($shvarname) = ($1);
if ($opt_warn_quoting && $check_quoting) {
$line->log_warning("Unquoted shell variable \$${shvarname}.");
}
-
} else {
last;
}
@@ -4115,7 +4114,14 @@ sub checkline_mk_shellword($$$) {
} elsif ($state == SWST_BACKT_DQUOT) {
if ($rest =~ s/^"//) {
$state = SWST_BACKT;
+
} elsif ($rest =~ s/^[^\\\"\'\`\$]+//) {
+
+ } elsif ($rest =~ s/^\\(?:[\\\"\`]|\$\$)//) {
+
+ } elsif ($rest =~ s/^\$\$\{([0-9A-Za-z_]+)\}//
+ || $rest =~ s/^\$\$([0-9A-Z_a-z]+|\$\$|[!#?\@])//) {
+ my ($shvarname) = ($1);
} else {
last;
}