summaryrefslogtreecommitdiff
path: root/databases/pgbadger/files/patch-pgbadger
blob: f469e209e9ea624ec6e627c809eb8f613f1f3f4e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
fix Possible precedence problem between ! and string eq

--- pgbadger.orig	2025-07-13 10:08:32 UTC
+++ pgbadger
@@ -20462,7 +20462,7 @@ sub highlight_code
     # lowercase/uppercase known functions or words followed by an open parenthesis
     # if the token is not a keyword, an open parenthesis or a comment
     if (($self->_is_function( $token, $last_token, $next_token ) && $next_token eq '(')
-	    || (!$self->_is_keyword( $token, $next_token, $last_token ) && !$next_token eq '('
+	    || (!$self->_is_keyword( $token, $next_token, $last_token ) && $next_token ne '('
 		    && $token ne '(' && !$self->_is_comment( $token )) ) {
         if ($self->{ 'uc_functions' } == 1) {
             $token = '<span class="kw2_l">' . $token . '</span>';
@@ -23062,7 +23062,7 @@ sub _add_token
         # if the token is not a keyword, an open parenthesis or a comment
         my $fct = $self->_is_function( $token, $last_token, $next_token ) || '';
         if (($fct and $next_token eq '(' and defined $last_token and uc($last_token) ne 'CREATE')
-		or (!$self->_is_keyword( $token, $next_token, $last_token ) and !$next_token eq '('
+		or (!$self->_is_keyword( $token, $next_token, $last_token ) and $next_token ne '('
 				    and $token ne '(' and !$self->_is_comment( $token )) )
 	{
             $token =~ s/$fct/\L$fct\E/i if ( $self->{ 'uc_functions' } == 1 );