]> git.donarmstrong.com Git - perltidy.git/commitdiff
fixed undefined variable problem
authorSteve Hancock <perltidy@users.sourceforge.net>
Tue, 12 May 2020 12:56:51 +0000 (05:56 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Tue, 12 May 2020 12:56:51 +0000 (05:56 -0700)
lib/Perl/Tidy/Formatter.pm

index e1c987fa5f6127a4a60cefb47307ad198d474021..b41896cc2482448dc0a5a6f28e9d59b1e8c6b235 100644 (file)
@@ -8389,9 +8389,12 @@ sub starting_one_line_block {
     }
 
     # the previous nonblank token should start these block types
-    elsif (( $i_last_nonblank >= 0 && $previous_nonblank_token eq $block_type )
-        || $block_type =~ /$ANYSUB_PATTERN/
-        || $block_type =~ /\(\)/ )
+    elsif (
+        $i_last_nonblank >= 0
+        && (   $previous_nonblank_token eq $block_type
+            || $block_type =~ /$ANYSUB_PATTERN/
+            || $block_type =~ /\(\)/ )
+      )
     {
         $i_start = $i_last_nonblank;