From: Steve Hancock Date: Thu, 17 Jun 2021 12:58:46 +0000 (-0700) Subject: Update LineSink.pm to allow undefined line endings X-Git-Tag: 20210402.01~7 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=26005335170def4461b97723b852b5e6a5c6f87f;p=perltidy.git Update LineSink.pm to allow undefined line endings --- diff --git a/lib/Perl/Tidy/LineSink.pm b/lib/Perl/Tidy/LineSink.pm index 9b05b36d..0dc09732 100644 --- a/lib/Perl/Tidy/LineSink.pm +++ b/lib/Perl/Tidy/LineSink.pm @@ -96,9 +96,11 @@ sub write_line { my ( $self, $line ) = @_; my $fh = $self->{_fh}; - my $output_file_open = $self->{_output_file_open}; - chomp $line; - $line .= $self->{_line_separator}; + my $line_separator = $self->{_line_separator}; + if ( defined($line_separator) ) { + chomp $line; + $line .= $line_separator; + } $fh->print($line) if ( $self->{_output_file_open} ); diff --git a/local-docs/BugLog.pod b/local-docs/BugLog.pod index ac3950db..21d8c010 100644 --- a/local-docs/BugLog.pod +++ b/local-docs/BugLog.pod @@ -2,12 +2,18 @@ =over 4 +=item B + +This update is necessary to eventually prevent an unwanted +terminal newline being added to a file. + +17 Jun 2021. + =item B This fixes an incorrect call which could cause an incorrect weld. -16 Jun 2021. - +16 Jun 2021, 068a28b. =item B @@ -16,7 +22,7 @@ between comment lines '#<>V' is passed verbatim to the output stream without error checking. It is simmilar to --format skipping but there is no error checking, and is useful for skipping an extended syntax. -16 Jun 2021. +16 Jun 2021, 99ec876. =item B