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 | d62fb8a8962c9c0e941f8bd43b1d2b7639f0999c (patch) | |
tree | b5919f77a8933ff58ff521c3eb6f23897267a8b5 | |
parent | 2d7c2b7a839a14a76b2ead59d6922aa54ab8c5f4 (diff) | |
download | pkgsrc-d62fb8a8962c9c0e941f8bd43b1d2b7639f0999c.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
-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]; |