Added some temporary variables so vim's syntax highlighting doesn't freak
authorAndy Lester <andy@petdance.com>
Fri, 5 Mar 2010 22:32:28 +0000 (16:32 -0600)
committerAndy Lester <andy@petdance.com>
Fri, 5 Mar 2010 22:32:28 +0000 (16:32 -0600)
check_postgres.pl

index 4a8d4b4afd2a1fc34772bdbf8a3e31e4291ec29a..f9d4d7521f110bddf4d943a810a2915ffd56426f 100755 (executable)
@@ -1051,9 +1051,11 @@ sub add_response {
                push @{$type->{''}} => [$msg, length $nohost > 1 ? $nohost : ''];
                return;
        }
+       my $dbservice = $db->{dbservice};
+       my $dbname    = $db->{dbname};
        my $header = sprintf q{%s%s%s},
-               $action_info->{$action}[0] ? '' : (defined $db->{dbservice} and length $db->{dbservice}) ?
-                       qq{service=$db->{dbservice} } : qq{DB "$db->{dbname}" },
+               $action_info->{$action}[0] ? '' : (defined $dbservice and length $dbservice) ?
+                       qq{service=$dbservice } : qq{DB "$dbname" },
                                $db->{host} eq '<none>' ? '' : qq{(host:$db->{host}) },
                                        defined $db->{port} ? ($db->{port} eq $opt{defaultport} ? '' : qq{(port=$db->{port}) }) : '';
        $header =~ s/\s+$//;