]> git.donarmstrong.com Git - perltidy.git/commitdiff
Update LineSink.pm to allow undefined line endings
authorSteve Hancock <perltidy@users.sourceforge.net>
Thu, 17 Jun 2021 12:58:46 +0000 (05:58 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Thu, 17 Jun 2021 12:58:46 +0000 (05:58 -0700)
lib/Perl/Tidy/LineSink.pm
local-docs/BugLog.pod

index 9b05b36de6f7c42ae8c12f128d1e3b74a6c17c22..0dc09732b3341737e8a9581c33ddd4242345179f 100644 (file)
@@ -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} );
 
index ac3950db9ab0bce9c601f627d3d190b68fb8ad9f..21d8c01085ef2f18ef7b7eddab6e7b65e2ccd7ab 100644 (file)
@@ -2,12 +2,18 @@
 
 =over 4
 
+=item B<Update LineSink.pm to allow undefined line endings>
+
+This update is necessary to eventually prevent an unwanted
+terminal newline being added to a file.
+
+17 Jun 2021.
+
 =item B<Fix incorrect sub call>
 
 This fixes an incorrect call which could cause an incorrect weld.
 
-16 Jun 2021.
-
+16 Jun 2021, 068a28b.
 
 =item B<Add --code-skipping option, see git #65>
 
@@ -16,7 +22,7 @@ between comment lines '#<<V' and '#>>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<Handle nested print format blocks>