From 373fac4cfd9e958a14b7decd6786a7abf3cbb0a9 Mon Sep 17 00:00:00 2001 From: Adam Heath Date: Sat, 25 May 2002 02:46:50 +0000 Subject: [PATCH] Properly count recursive expansion of variables, instead of just counting all variable expansions. --- ChangeLog | 5 +++++ debian/changelog | 2 ++ scripts/controllib.pl | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index f6833796..b8e08825 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri May 24 21:49:52 CDT 2002 Adam Heath + + * scripts/controllib.pl: Properly count recursive expansion of variables, + instead of just counting all variable expansions. + Fri May 24 21:20:04 CDT 2002 Adam Heath * scripts/cl-debian.pl: Recognize emergency as valid in changelogs. diff --git a/debian/changelog b/debian/changelog index d1f18693..465fa371 100644 --- a/debian/changelog +++ b/debian/changelog @@ -103,6 +103,8 @@ dpkg (1.10) unstable; urgency=low Closes: Bug#140441. * cl-debian.pl now recognizes emergency as valid in changelogs. Closes: Bug#138013. + * Properly count recursive expansion of variables, instead of just + counting all variable expansions. Closes: #144121. -- Wichert Akkerman Mon, 20 Aug 2001 14:54:38 +0200 diff --git a/scripts/controllib.pl b/scripts/controllib.pl index 7b70e75a..ade70071 100755 --- a/scripts/controllib.pl +++ b/scripts/controllib.pl @@ -81,6 +81,10 @@ sub substvars { my ($lhs,$vn,$rhs,$count); $count=0; while ($v =~ m/\$\{([-:0-9a-z]+)\}/i) { + # If we have consumed more from the leftover data, then + # reset the recursive counter. + $count= 0 if (length($') < length($rhs)); + $count < $maxsubsts || &error("too many substitutions - recursive ? - in \`$v'"); $lhs=$`; $vn=$1; $rhs=$'; -- 2.39.5