Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!columbia!topaz!mende From: mende@topaz.RUTGERS.EDU (Mende) Newsgroups: net.micro.amiga Subject: possible bug in 1.1 file redirection Message-ID: <5420@topaz.RUTGERS.EDU> Date: Fri, 25-Jul-86 16:21:34 EDT Article-I.D.: topaz.5420 Posted: Fri Jul 25 16:21:34 1986 Date-Received: Fri, 25-Jul-86 21:58:00 EDT Organization: Rutgers Univ., New Brunswick, N.J. Lines: 39 Keywords: file redirection , bug I am posting this for a friend of mine who has no access to the net. I have looked at the problem and it baffles me. So here it is.... /* I am programming on an Amiga with Aztec C (developer's package) and have come accross the following problem. It may be a bug in the Aztec compiler or a bug in AmigaDOS. My program is simply a filter to do a word-wrap on standard ASCII files. The program below is just enough to demonstrate the problem. The below program should read standard input (line by line) and output it (line by line) to standard output. When I compile this (or the filter) and issue the command: THRU FOO then: TYPE FOO the output is different. The end is cut off. Why would this work if the IO is sent to the screen but not to a file? I have written filters before but they worked purely on a getchar()/putchar() basis. Could I be misusing the fgets()/fputs() commands? P.S. THRU * works fine too! */ #include #define MAXLINE 100 main() /* Program thru.c */ { register char *line[MAXLINE]; while ( (fgets(line, MAXLINE, stdin)) != 0 ) fputs(line, stdout); } Bob Mende posting for Tom Limoncelli ARPA: MENDE@AIM.RUTGERS.EDU UUCP: {anywhere}!{topaz!caip}!aim!mende