view mc09/test/cp.c @ 178:4d83154d2a78

add - {} some builtin in TL/1
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 15 Apr 2019 09:43:28 +0900
parents 1a30cd6e5973
children
line wrap: on
line source

#include "mclibos9.c"

int
main(argc,argv) 
int argc;char *argv[]; {
    FILE *input ; 
    FILE *output ; 
    int c;
    int i;

    input = stdin;
    output = stdout;

    i = 1;
    if (argv[i]) { input = fopen(argv[i++],"r"); }
    if (argv[i]) { output = fopen(argv[i++],"w"); }
    if (input==0 || output==0) return 0;
    while( (c = getc(input) ) !=  -1) {
        putc(c,output);
    }
    return 1;
}