Commit 0c03ed60 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

modified loadtest() to produce better error message when it fails to load

a test file
parent 0c3c1b39
Loading
Loading
Loading
Loading
+12 −13
Original line number Diff line number Diff line
@@ -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;
}