Mercurial > hg > Members > kono > os9 > sbc09
annotate mc09/test/cp.c @ 191:d0f5894e9b3a default tip
some how load: confilicts in gmake
author | kono |
---|---|
date | Thu, 07 Dec 2023 09:37:15 +0900 |
parents | 1a30cd6e5973 |
children |
rev | line source |
---|---|
107 | 1 #include "mclibos9.c" |
2 | |
3 int | |
4 main(argc,argv) | |
5 int argc;char *argv[]; { | |
6 FILE *input ; | |
7 FILE *output ; | |
8 int c; | |
9 int i; | |
10 | |
132 | 11 input = stdin; |
12 output = stdout; | |
107 | 13 |
14 i = 1; | |
15 if (argv[i]) { input = fopen(argv[i++],"r"); } | |
16 if (argv[i]) { output = fopen(argv[i++],"w"); } | |
132 | 17 if (input==0 || output==0) return 0; |
107 | 18 while( (c = getc(input) ) != -1) { |
19 putc(c,output); | |
20 } | |
21 return 1; | |
22 } |