aboutsummaryrefslogtreecommitdiffstats
path: root/c/cat.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/cat.c')
-rw-r--r--c/cat.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/c/cat.c b/c/cat.c
new file mode 100644
index 0000000..4092778
--- /dev/null
+++ b/c/cat.c
@@ -0,0 +1,10 @@
+#include "gbos.h"
+/* cat: copy stdin to stdout until EOF (Ctrl-D / pipe end). */
+void main(void) {
+ char c;
+ for (;;) {
+ c = readc();
+ if (c == EOF) break;
+ putc(c);
+ }
+}