sbase

suckless unix tools
git clone git://git.suckless.org/sbase
Log | Files | Refs | README | LICENSE

commit d898b61ed22e7d7ced081cbf2f646c82cbf88f00
parent 9febd6d57c98d8d29c6d9abac3839b1614dcae15
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date:   Thu, 11 Dec 2025 21:55:06 +0100

bc: Don't pop value from body in while

Statements already deal with the cleaning of the stack, but the
init and increment part of for loops are expressions without the
cleaning, and for that reason we have to care about the stack.

Diffstat:
Mbc.y | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bc.y b/bc.y @@ -465,7 +465,7 @@ whilecode(Macro *d, char *cmp, char *body) { char *s; - s = code("[%ss.%s%c]s%c", + s = code("[%s%s%c]s%c", body, estrdup(cmp), d->id, d->id);