runtests and friends: Do not add undefined values to @INC
authorFabian Keil <fk@fabiankeil.de>
Wed, 14 Nov 2012 10:40:31 +0000 (11:40 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 6 Dec 2012 22:04:33 +0000 (23:04 +0100)
On FreeBSD this fixes the warning:
Use of uninitialized value $p in string eq at /usr/local/lib/perl5/5.14.2/BSDPAN/BSDPAN.pm line 36.

tests/ftpserver.pl
tests/httpserver.pl
tests/keywords.pl
tests/rtspserver.pl
tests/runtests.pl
tests/secureserver.pl
tests/tftpserver.pl

index 6e6f691d4abb25912cdd5c72984a6c1b94ae85e8..45b343635df6750bba231e7ed22515a0fbab1044 100755 (executable)
@@ -39,7 +39,8 @@
 #
 
 BEGIN {
-    @INC=(@INC, $ENV{'srcdir'}, '.');
+    push(@INC, $ENV{'srcdir'}) if(defined $ENV{'srcdir'});
+    push(@INC, ".");
     # sub second timestamping needs Time::HiRes
     eval {
         no warnings "all";
index d5c4dfb27cfcf4f22c2429ebeb4fbb6ff67b5c24..a38c3cebd61d25db15e3d2cc12df9b7087c1bd5e 100755 (executable)
@@ -22,7 +22,8 @@
 #***************************************************************************
 
 BEGIN {
-    @INC=(@INC, $ENV{'srcdir'}, '.');
+    push(@INC, $ENV{'srcdir'}) if(defined $ENV{'srcdir'});
+    push(@INC, ".");
 }
 
 use strict;
index 523bde1fcba22a7ac44fe59eb8318dfa57289a62..28646ad00bda85ab51f9e64daaeba1da447780ba 100755 (executable)
@@ -23,7 +23,8 @@
 
 use strict;
 
-@INC=(@INC, $ENV{'srcdir'}, ".");
+push(@INC, $ENV{'srcdir'}) if(defined $ENV{'srcdir'});
+push(@INC, ".");
 
 require "getpart.pm"; # array functions
 
index 515128d7ba37f93c6b2f222dad82642b8a7e03a3..07a588ecd69fe3e7f5392b4102c2a31ae4a037e7 100755 (executable)
@@ -22,7 +22,8 @@
 #***************************************************************************
 
 BEGIN {
-    @INC=(@INC, $ENV{'srcdir'}, '.');
+    push(@INC, $ENV{'srcdir'}) if(defined $ENV{'srcdir'});
+    push(@INC, ".");
 }
 
 use strict;
index 27fff4a954a1f1200faac2b919b3687fe4611b2b..0b2559ecd3b0f54d96cdb40766cdd60c9933ab44 100755 (executable)
@@ -56,7 +56,8 @@
 # These should be the only variables that might be needed to get edited:
 
 BEGIN {
-    @INC=(@INC, $ENV{'srcdir'}, ".");
+    push(@INC, $ENV{'srcdir'}) if(defined $ENV{'srcdir'});
+    push(@INC, ".");
     # run time statistics needs Time::HiRes
     eval {
         no warnings "all";
index 064fa84f5e06b227e5e7b754e1a7931dc3e0a2b1..36a902e5a0eecac25b44e7ece50deec93b29b8b3 100755 (executable)
@@ -26,7 +26,8 @@
 # non-secure test harness servers.
 
 BEGIN {
-    @INC=(@INC, $ENV{'srcdir'}, '.');
+    push(@INC, $ENV{'srcdir'}) if(defined $ENV{'srcdir'});
+    push(@INC, ".");
 }
 
 use strict;
index c5382ec66861377b383753b2e27bd721a8b5ceff..60fc32d19405ae0cbade51b7ad67b22100047ed8 100755 (executable)
@@ -22,7 +22,8 @@
 #***************************************************************************
 
 BEGIN {
-    @INC=(@INC, $ENV{'srcdir'}, '.');
+    push(@INC, $ENV{'srcdir'}) if(defined $ENV{'srcdir'});
+    push(@INC, ".");
 }
 
 use strict;