mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
modified loadtest() to produce better error message when it fails to load
a test file
This commit is contained in:
parent
0c3c1b390a
commit
0c03ed6013
@ -92,21 +92,20 @@ sub getpart {
|
||||
sub loadtest {
|
||||
my ($file)=@_;
|
||||
|
||||
my $dir;
|
||||
$dir = $ENV{'srcdir'};
|
||||
if(!$dir) {
|
||||
$dir=".";
|
||||
}
|
||||
|
||||
|
||||
undef @xml;
|
||||
open(XML, "<$dir/$file") ||
|
||||
return 1; # failure!
|
||||
|
||||
if(open(XML, "<$file")) {
|
||||
binmode XML; # for crapage systems, use binary
|
||||
while(<XML>) {
|
||||
push @xml, $_;
|
||||
}
|
||||
close(XML);
|
||||
}
|
||||
else {
|
||||
# failure
|
||||
print STDERR "file $file wouldn't open!\n";
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user