[hackers] [sbase] bc: Read stdin after a list of files || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Tue, 25 Nov 2025 21:12:57 +0100 (CET)

commit 4d7926403e6860a915d2f3de5f6fe2b297ebb2e4
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.net>
AuthorDate: Tue Nov 25 21:10:49 2025 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.net>
CommitDate: Tue Nov 25 21:10:49 2025 +0100

    bc: Read stdin after a list of files
    
    POSIX mandates "It shall take input from any files given, then read
    from the standard input."

diff --git a/bc.y b/bc.y
index 3f51382..d2f423d 100644
--- a/bc.y
+++ b/bc.y
_AT_@ -843,12 +843,9 @@ main(int argc, char *argv[])
         if (lflag)
                 loadlib();
 
- if (*argv == NULL) {
- bc(NULL);
- } else {
- while (*argv)
- bc(*argv++);
- }
+ while (*argv)
+ bc(*argv++);
+ bc(NULL);
 
         quit();
 }
Received on Tue Nov 25 2025 - 21:12:57 CET

This archive was generated by hypermail 2.3.0 : Tue Nov 25 2025 - 21:24:36 CET