Subject: | Perl::Tidy sometimes does not call binmode |
Date: | Wed, 7 Jun 2017 16:30:19 +0300 |
To: | bug-Perl-Tidy [...] rt.cpan.org |
From: | Irilis Aelae <irilis.aelae [...] gmail.com> |
perltidy v20170521
perl 5, version 24, subversion 1 (v5.24.1) built for
MSWin32-x64-multi-thread
Binary build 2402 [401627] provided by ActiveState
http://www.ActiveState.com
Built Jan 5 2017 02:08:02
OS: Windows 8.1
perltidy arguments:
--character-encoding=none (default)
without --standard-output
--output-line-ending=unix or --preserve-line-endings with unix line endings.
Bug description: when called with above arguments Perl::Tidy::LineSink::new
does not call binmode for output file.
Result: under windows, line endings ignore setting
--output-line-ending=unix and change to windows default.
My patch:
add this
Show quoted text
> else {
> if ( ref($fh) eq 'IO::File' ) {
> $fh->binmode();
> }
> elsif ( $output_file eq '-' ) {
> binmode STDOUT;
> }
> }
into Perl::Tidy::LineSink::new after
Show quoted text> elsif ( $output_file eq '-' ) { binmode STDOUT }