Commit 6a948491 authored by Bill Medland's avatar Bill Medland Committed by Alexandre Julliard

Correct the comparison of two files. Just because they are the same

size doesn't mean they have the same content.
parent 07db325e
...@@ -38,7 +38,7 @@ test_regedit(); ...@@ -38,7 +38,7 @@ test_regedit();
# } # }
#} #}
# Checks if the files are equal regardless of the encoding. # Checks if the files are equal regardless of the end-of-line encoding.
# Returns 0 if the files are different, otherwise returns 1 # Returns 0 if the files are different, otherwise returns 1
# params - list of file names # params - list of file names
sub files_are_equal sub files_are_equal
...@@ -48,19 +48,6 @@ sub files_are_equal ...@@ -48,19 +48,6 @@ sub files_are_equal
die "At least 2 file names expected" unless ($#file_names); die "At least 2 file names expected" unless ($#file_names);
#compare the files sizes
my $sizes_are_equal = 1;
foreach my $file_name (@file_names)
{
-e $file_name || die "Error! File $file_name does not exist";
if (-s $file_names[0] != -s $file_name)
{
$sizes_are_equal = 0;
last;
}
}
return 1 if $sizes_are_equal;
#compare file contents #compare file contents
foreach my $file_name (@file_names) foreach my $file_name (@file_names)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment