]> git.donarmstrong.com Git - perltidy.git/commitdiff
clean up some cr/lf code
authorSteve Hancock <perltidy@users.sourceforge.net>
Sat, 26 Aug 2023 22:57:24 +0000 (15:57 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sat, 26 Aug 2023 22:57:24 +0000 (15:57 -0700)
lib/Perl/Tidy.pm

index 413c9aa1ed940ca82b4ccc59f12c7ed997b09e80..1f3a40dc067bb56ac1fb7cb049555cff49a3a796 100644 (file)
@@ -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;
             }