Hello!
I noted that the manpage of dc(1) reports a detail which is inconsistent
with the actual behaviour. Right at the beginning, it states the
following: 'If an argument is given, input is taken from that file until
its end, then from the standard input.'
In fact though, when started with an argument, the file is read and dc
then exits. The attached patch fixes this.
Cheers,
s//un
--- dc.c.orig Mon Aug 6 11:41:34 2012
+++ dc.c Mon Aug 6 11:41:36 2012
@@ -99,11 +99,6 @@
reset_bmachine(&src);
eval();
(void)fclose(file);
- /*
- * BSD and Solaris dc(1) continue with stdin after processing
- * the file given as the argument. We follow GNU dc(1).
- */
- return (0);
}
src_setstream(&src, stdin);
reset_bmachine(&src);