diff options
author | rillig <rillig@pkgsrc.org> | 2006-07-15 06:57:51 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2006-07-15 06:57:51 +0000 |
commit | d1d426a297da3df107dec985998c6cec596725de (patch) | |
tree | b5919f77a8933ff58ff521c3eb6f23897267a8b5 /pkgtools | |
parent | bde163e40eec254ef05c6ee20fa5acec1b655d05 (diff) | |
download | pkgsrc-d1d426a297da3df107dec985998c6cec596725de.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')
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 7 |
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]; |