[exim-cvs] Testsuite: make system $more safe

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] Testsuite: make system $more safe
Gitweb: https://git.exim.org/exim.git/commitdiff/a31c0dcde94eefd57201bdfbc34d3c07bb953630
Commit:     a31c0dcde94eefd57201bdfbc34d3c07bb953630
Parent:     ef5bf13bbc9895614733272a914c1966890d4b3e
Author:     Heiko Schlittermann (HS12-RIPE) <hs@???>
AuthorDate: Fri Nov 29 17:37:26 2019 +0800
Committer:  Heiko Schlittermann (HS12-RIPE) <hs@???>
CommitDate: Fri Nov 29 16:46:29 2019 +0100


    Testsuite: make system $more safe
---
 test/runtest | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)


diff --git a/test/runtest b/test/runtest
index 1ec546e..358e2ba 100755
--- a/test/runtest
+++ b/test/runtest
@@ -64,7 +64,7 @@ my $force_continue = 0;
 my $force_update = 0;
 my $log_failed_filename = 'failed-summary.log';
 my $log_summary_filename = 'run-summary.log';
-my $more = 'less -XF';
+my @more = qw'less -XF';
 my $optargs = '';
 my $save_output = 0;
 my $server_opts = '';
@@ -1550,7 +1550,7 @@ if (! -e $sf_current)
       print "\n";
       print "------------ $f -----------\n"
         if (defined $rf && -s $rf && defined $rsf && -s $rsf);
-      system("$more '$f'");
+      system @more => $f;
       }
     }


@@ -1674,7 +1674,7 @@ if (-e $sf_current)
# Handle comparison failure

print "** Comparison of $mf with $sf_current failed";
- system("$more test-cf");
+ system @more => 'test-cf';

   print "\n";
   for (;;)
@@ -2793,7 +2793,7 @@ umask 022;
 #       Check for the "less" command             #
 ##################################################


-$more = 'more' if system('which less >/dev/null 2>&1') != 0;
+@more = 'more' if system('which less >/dev/null 2>&1') != 0;



@@ -2818,7 +2818,7 @@ Getopt::Long::Configure qw(no_getopt_compat);
 GetOptions(
     'debug'    => sub { $debug          = 1; $cr   = "\n" },
     'diff'     => sub { $cf             = 'diff -u' },
-    'continue' => sub { $force_continue = 1; $more = 'cat' },
+    'continue' => sub { $force_continue = 1; @more = 'cat' },
     'update'   => \$force_update,
     'ipv4!'    => \$have_ipv4,
     'ipv6!'    => \$have_ipv6,
@@ -4313,11 +4313,11 @@ foreach $test (@test_list)
         last if /^[rc]$/i;
         if (/^e$/i)
           {
-          system("$more test-stderr");
+          system @more => 'test-stderr';
           }
         elsif (/^o$/i)
           {
-          system("$more test-stdout");
+          system @more => 'test-stdout';
           }
         }