From: Steve Hancock Date: Sun, 13 Sep 2020 22:46:59 +0000 (-0700) Subject: fixed unitialized variable problem X-Git-Tag: 20200907.01~10 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=adb20963af804ddd7c9e9953f55d6b41ff22fc1e;p=perltidy.git fixed unitialized variable problem --- diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 2cba7e0c..06136cb9 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -11922,7 +11922,12 @@ sub lookup_opening_indentation { # handle option to indent non-blocks of the form ); }; ]; # But don't do special indentation to something like ')->pack(' if ( !$block_type_to_go[$ibeg] ) { - my $cti = $closing_token_indentation{ $tokens_to_go[$ibeg] }; + + # Note that logical padding has already been applied, so we may + # need to remove some spaces to get a valid hash key. + my $tok = $tokens_to_go[$ibeg]; + if ( length($tok) > 1 ) { $tok =~ s/\s//g } + my $cti = $closing_token_indentation{ $tok }; if ( $cti == 1 ) { if ( $i_terminal <= $ibeg + 1 || $is_semicolon_terminated )