bc: Fix relational operators - sbase - suckless unix tools
 (HTM) git clone git://git.suckless.org/sbase
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 301f018935abc4a61f37e126085c2824ebc49257
 (DIR) parent fbc4b4252455a126c552e6b4b35adb643ff1135c
 (HTM) Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
       Date:   Thu, 11 Dec 2025 08:46:17 +0100
       
       bc: Fix relational operators
       
       The order of the operands was wrong and it produced the
       inverse operation.
       
       Diffstat:
         M bc.y                                |      12 ++++++------
       
       1 file changed, 6 insertions(+), 6 deletions(-)
       ---
 (DIR) diff --git a/bc.y b/bc.y
       @@ -194,12 +194,12 @@ cond    : '(' rel ')'           {$$ = $2;}
                ;
        
        rel     : expr                  {$$ = code("%s 0!=", $1);}
       -        | expr EQ expr          {$$ = code("%s%s=", $3, $1);}
       -        | expr LE expr          {$$ = code("%s%s!>", $3, $1);}
       -        | expr GE expr          {$$ = code("%s%s!<", $3, $1);}
       -        | expr NE expr          {$$ = code("%s%s!=", $3, $1);}
       -        | expr '<' expr         {$$ = code("%s%s<", $3, $1);}
       -        | expr '>' expr         {$$ = code("%s%s>", $3, $1);}
       +        | expr EQ expr          {$$ = code("%s%s=", $1, $3);}
       +        | expr LE expr          {$$ = code("%s%s!<", $1, $3);}
       +        | expr GE expr          {$$ = code("%s%s!>", $1, $3);}
       +        | expr NE expr          {$$ = code("%s%s!=", $1, $3);}
       +        | expr '<' expr         {$$ = code("%s%s>", $1, $3);}
       +        | expr '>' expr         {$$ = code("%s%s<", $1, $3);}
                ;
        
        exprstat: nexpr                 {$$ = code("%s%ss.", $1, code(sflag ? "" : "p"));}