summaryrefslogtreecommitdiff
path: root/pkgtools/pkglint
diff options
context:
space:
mode:
authorrillig <rillig>2006-07-15 06:57:51 +0000
committerrillig <rillig>2006-07-15 06:57:51 +0000
commit7d5d4a6e741425a1cb6a5e09fbc522651e91f939 (patch)
treeb5919f77a8933ff58ff521c3eb6f23897267a8b5 /pkgtools/pkglint
parent8040638b81faea376223a4b2b5cc581afd52fb43 (diff)
downloadpkgsrc-7d5d4a6e741425a1cb6a5e09fbc522651e91f939.tar.gz
Fixed the very stack-consuming regular expression regex_varassign so
that it only needs 256 kB of stack memory instead of more than 2 MB. See also http://rt.perl.org/rt3/Public/Bug/Display.html?id=39774
Diffstat (limited to 'pkgtools/pkglint')
-rw-r--r--pkgtools/pkglint/files/pkglint.pl7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 71939208824..f427ff7ef97 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -1,5 +1,5 @@
#! @PERL@
-# $NetBSD: pkglint.pl,v 1.646 2006/07/14 04:54:58 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.647 2006/07/15 06:57:51 rillig Exp $
#
# pkglint - static analyzer and checker for pkgsrc packages
@@ -1756,7 +1756,7 @@ use constant regex_pkgname => qr"^((?:[\w.+]|-[^\d])+)-(\d(?:\w|\.\d)*)$";
use constant regex_shellcmd => qr"^\t(.*)$";
use constant regex_unresolved => qr"\$\{";
use constant regex_validchars => qr"[\011\040-\176]";
-use constant regex_varassign => qr"^([-*+A-Z_a-z0-9.\${}\[]+?)\s*(=|\?=|\+=|:=|!=)\s*((?:\\#|[^#])*?)(?:\s*(#.*))?$";
+use constant regex_varassign => qr"^([-*+A-Z_a-z0-9.\${}\[]+?)\s*(=|\?=|\+=|:=|!=)\s*((?:\\#|[^#]+)*?)(?:\s*(#.*))?$";
use constant regex_sh_varassign => qr"^([A-Z_a-z][0-9A-Z_a-z]*)=";
# The following "constants" are often used in contexts where
@@ -5316,7 +5316,8 @@ sub checklines_mk($) {
my ($allowed_targets) = ({});
my ($substcontext) = PkgLint::SubstContext->new();
- $opt_debug_trace and log_debug((@{$lines} != 0) ? $lines->[0]->fname : NO_FILE, NO_LINES, "checklines_mk()");
+ assert(@{$lines} != 0);
+ $opt_debug_trace and log_debug($lines->[0]->fname, NO_LINES, "checklines_mk()");
# Define global variables for the Makefile context.
$mkctx_indentations = [0];