[hackers] [sbase] bc: Don't pop value from body in while || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Thu, 11 Dec 2025 21:57:19 +0100 (CET)

commit d898b61ed22e7d7ced081cbf2f646c82cbf88f00
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.net>
AuthorDate: Thu Dec 11 21:55:06 2025 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.net>
CommitDate: Thu Dec 11 21:55:06 2025 +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.

diff --git a/bc.y b/bc.y
index 1d1e2c0..8e50e20 100644
--- a/bc.y
+++ b/bc.y
_AT_@ -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);
Received on Thu Dec 11 2025 - 21:57:19 CET

This archive was generated by hypermail 2.3.0 : Thu Dec 11 2025 - 22:00:35 CET