This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Stop pod/buildtoc from changing EOLs on Win32
authorSteve Hay <steve.m.hay@googlemail.com>
Sun, 21 Feb 2010 19:41:49 +0000 (19:41 +0000)
committerSteve Hay <steve.m.hay@googlemail.com>
Sun, 21 Feb 2010 19:41:49 +0000 (19:41 +0000)
pod/buildtoc

index 4dd4271..12cbc94 100755 (executable)
@@ -748,6 +748,7 @@ while (my ($target, $name) = each %Targets) {
   }
   print "Now processing $name\n" if $Verbose;
   open THING, $name or die "Can't open $name: $!";
+  binmode THING;
   my @orig = <THING>;
   my $orig = join '', @orig;
   close THING;
@@ -762,6 +763,7 @@ while (my ($target, $name) = each %Targets) {
   }
   rename $name, "$name.old" or die "$0: Can't rename $name to $name.old: $!";
   open THING, ">$name" or die "$0: Can't open $name for writing: $!";
+  binmode THING;
   print THING $new or die "$0: print to $name failed: $!";
   close THING or die "$0: close $name failed: $!";
 }