From: Steve Hancock Date: Sat, 26 Aug 2023 22:57:24 +0000 (-0700) Subject: clean up some cr/lf code X-Git-Tag: 20230701.04~17 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5d84a9af6123d79c59a8b00b7ef46b20d91a0dd8;p=perltidy.git clean up some cr/lf code --- diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm index 413c9aa1..1f3a40dc 100644 --- a/lib/Perl/Tidy.pm +++ b/lib/Perl/Tidy.pm @@ -1783,17 +1783,17 @@ sub set_line_separator { my $test = $1; # dos - if ( $test =~ /^($CRLF)+$/ ) { + if ( $test =~ /^($CRLF)+\z/ ) { $input_line_separator = $CRLF; } # mac - elsif ( $test =~ /^($CR)+$/ && $test !~ /$LF/ ) { + elsif ( $test =~ /^($CR)+\z/ ) { $input_line_separator = $CR; } # unix - elsif ( $test =~ /^($LF)+$/ && $test !~ /$CR/ ) { + elsif ( $test =~ /^($LF)+\z/ ) { $input_line_separator = $LF; }