Francois Gouget : testbot/cgi: Fix ItemPage's iteration over the master columns.

Alexandre Julliard julliard at winehq.org
Mon Apr 25 13:30:49 CDT 2022


Module: tools
Branch: master
Commit: e244074494de8a06fcdb09ce9b3f720bceac8b07
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=e244074494de8a06fcdb09ce9b3f720bceac8b07

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Mon Apr 25 18:49:21 2022 +0200

testbot/cgi: Fix ItemPage's iteration over the master columns.

GenerateFormStart() went one iteration too far which is okay only
because our pages never have master columns in the first place.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 testbot/lib/ObjectModel/CGI/ItemPage.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testbot/lib/ObjectModel/CGI/ItemPage.pm b/testbot/lib/ObjectModel/CGI/ItemPage.pm
index b88e273..1b77eea 100644
--- a/testbot/lib/ObjectModel/CGI/ItemPage.pm
+++ b/testbot/lib/ObjectModel/CGI/ItemPage.pm
@@ -109,7 +109,7 @@ sub GenerateFormStart($)
   my ($MasterColNames, $MasterColValues) = $self->{Collection}->GetMasterCols();
   if (defined($MasterColNames))
   {
-    foreach my $ColIndex (0 .. @$MasterColNames)
+    foreach my $ColIndex (0..$#{$MasterColNames})
     {
       print "<div><input type='hidden' name='", $MasterColNames->[$ColIndex],
             "' value='", $self->escapeHTML($MasterColValues->[$ColIndex]),
@@ -146,7 +146,7 @@ sub RedirectToList($)
   my ($MasterColNames, $MasterColValues) = $self->{Collection}->GetMasterCols();
   if (defined($MasterColNames))
   {
-    foreach my $ColIndex (0 .. @$MasterColNames - 1)
+    foreach my $ColIndex (0..$#{$MasterColNames})
     {
       $Target .= ($ColIndex == 0 ? "?" : "&") . $MasterColNames->[$ColIndex] .
                  "=" . url_escape($MasterColValues->[$ColIndex]);




More information about the wine-cvs mailing list