commit 4d7926403e6860a915d2f3de5f6fe2b297ebb2e4
parent 2cf8559bad6eef27f2f4279afb0282f678a95c09
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 25 Nov 2025 21:10:49 +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."
Diffstat:
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/bc.y b/bc.y
@@ -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();
}