view 3rdparty/packages/cc/sources/line.c @ 2434:eab6b9e18832

update defs for RFM
author aaronwolfe
date Sun, 21 Feb 2010 06:24:47 +0000
parents 0198655f2552
children
line wrap: on
line source

/* line:  list lines of file with numbers */

#include <stdio.h>

main(argc,argv)
char **argv;
{
     char line[256];
     register int count = 0;

     if(--argc)
          if(freopen(*++argv,"r",stdin) == NULL) {
               fprintf(stderr,"can't open file: %s\n",*argv);
               exit(errno);
          }

     while(gets(line))
          printf("%5d %s\n",++count,line);
}