]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(main): Iterate over the sorted keys (rather than `while...each...'),
authorJim Meyering <jim@meyering.net>
Sun, 12 Aug 2001 17:44:03 +0000 (17:44 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 12 Aug 2001 17:44:03 +0000 (17:44 +0000)
so this script produces the same output regardless of which version
of perl (e.g., perl5.6) is used.

tests/mk-script

index a0fab2c909d4e91e872a316c4b70045f5bd3bcec..b8bf735b7e2d3d9eeeb030be47efd8e640b23a90 100755 (executable)
@@ -273,10 +273,11 @@ EOF1
        || {FILE => 0};
 
       my $n_vias = keys %$vias;
-      my ($via, $val);
-      while (($via, $val) = each %$vias)
+      my $via;
+      foreach $via (sort keys %$vias)
        {
          my $cmd;
+         my $val = $vias->{$via};
          my $via_msg = ($n_vias == 1 ? '' : $via_msg_string{$via});
          my $file_args = join (' ', @srcdir_rel_in_file);