Skip to content

Commit

Permalink
bc: assign '=' should not print (#517)
Browse files Browse the repository at this point in the history
* Previously this change was committed for internal =P instruction, which runs when assigning an array value, e.g. "ary[0] = 1"
* I missed the =V instruction for regular variable assignment
* Instruction =V happens for shortcut assignment operators too
* This patch makes bc agree with GNU version and Gavin Howard version

x = 1
x += 2
x -= 1
x *= 4
x /= 2
x ^= 2
  • Loading branch information
mknos committed Mar 24, 2024
1 parent 78bcd31 commit 52792d7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions bin/bc
Expand Up @@ -2518,6 +2518,7 @@ sub exec_stmt
$sym_table{$varName} = { type => 'var',
value => $value };
push(@ope_stack, $value);
$return = 1; # do not print result
next INSTR;

} elsif($_ eq '=P') {
Expand Down

0 comments on commit 52792d7

Please sign in to comment.