]> granicus.if.org Git - curl/commitdiff
runtests: fix "use of undefined value" warning in -R handling
authorDaniel Stenberg <daniel@haxx.se>
Mon, 8 May 2017 08:08:48 +0000 (10:08 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 8 May 2017 08:09:06 +0000 (10:09 +0200)
tests/runtests.pl

index 48e26142f89da90e3b8561f3f7a8719c416190f5..d20383ae86024e06337df18c0eb78a35e0713179 100755 (executable)
@@ -5179,7 +5179,11 @@ if($scrambleorder) {
     # scramble the order of the test cases
     my @rand;
     while($TESTCASES) {
-        my @all = split(/ /, $TESTCASES);
+        my @all = split(/ +/, $TESTCASES);
+        if(!$all[0]) {
+            # if the first is blank, shift away it
+            shift @all;
+        }
         my $r = rand @all;
         push @rand, $all[$r];
         $all[$r]="";