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 {
|
sub loadtest {
|
||||||
my ($file)=@_;
|
my ($file)=@_;
|
||||||
|
|
||||||
my $dir;
|
|
||||||
$dir = $ENV{'srcdir'};
|
|
||||||
if(!$dir) {
|
|
||||||
$dir=".";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
undef @xml;
|
undef @xml;
|
||||||
open(XML, "<$dir/$file") ||
|
|
||||||
return 1; # failure!
|
if(open(XML, "<$file")) {
|
||||||
binmode XML; # for crapage systems, use binary
|
binmode XML; # for crapage systems, use binary
|
||||||
while(<XML>) {
|
while(<XML>) {
|
||||||
push @xml, $_;
|
push @xml, $_;
|
||||||
|
}
|
||||||
|
close(XML);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
# failure
|
||||||
|
print STDERR "file $file wouldn't open!\n";
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
close(XML);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user