From dda8e7d233f5bae9be453c00680d66ffcdf41604 Mon Sep 17 00:00:00 2001 From: acli Date: Mon, 23 Feb 2004 04:36:56 +0000 Subject: [PATCH] Off-by-one bug --- misc/translator/TmplTokenizer.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/misc/translator/TmplTokenizer.pm b/misc/translator/TmplTokenizer.pm index a7f850345e..fc22c7960d 100644 --- a/misc/translator/TmplTokenizer.pm +++ b/misc/translator/TmplTokenizer.pm @@ -664,7 +664,11 @@ sub parametrize ($$$) { my($i, $width, $prec) = ((defined $1? $1: $n), $2, $3); $fmt = $'; if (!defined $width && !defined $prec) { - $it .= $params->[$i] + my $param = $params->[$i - 1]; + $it .= $param; + warn_normal "$&: Undefined parameter $i for msgid \"$fmt_0\"", + undef + unless defined $param; } elsif (defined $width && defined $prec && !$width && !$prec) { ; } else { -- 2.39.5