Change 26225, updated by 26245, added a test for another filename with
a trailing space but failed to open the new filehandle in binary mode
To compound matters, creating a file called "foo " on Win32 "succeeds"
but actually creates a file called just "foo", so we have actually
overwritten the original file with this non-binary mode version, and
hence some of the original tests started failing too!
(And because of this the new test doesn't actually add anything new on
Win32 at the moment, but right now I can't think of a filename that
would have failed under 2-arg open but succeeds with 3-arg open, which
was the purpose of this test)
p4raw-id: //depot/perl@26337
my $template = File::Spec->catfile(File::Spec->tmpdir, 'fcmpXXXX');
my($tfh,$filename) = mkstemp($template);
# NB. The trailing space is intentional (see [perl #37716])
- open my $tfhCR, ">", "$filename "
- or die "Could no open '$filename^M' for writing: $!";
+ open my $tfhSP, ">", "$filename "
+ or die "Could not open '$filename ' for writing: $!";
+ binmode($tfhSP);
{
local $/; #slurp
my $fh;
my $data = <$fh>;
print $tfh $data;
close($fh);
- print $tfhCR $data;
- close($tfhCR);
+ print $tfhSP $data;
+ close($tfhSP);
}
seek($tfh,0,0);
$donetests[0] = compare($tfh, 'README');