Files
rtems/cpukit/libmisc/shell/cat_file.c
Joel Sherrill 9b4422a251 Remove All CVS Id Strings Possible Using a Script
Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines
  next to each other after Id string line removed.
+ remove entire comment blocks which only exited to
  contain CVS Ids
+ If the processing left a blank line at the top of
  a file, it was removed.
2012-05-11 08:44:13 -05:00

37 lines
622 B
C

/*
* CAT Command Implementation
*
* Author:
* WORK: fernando.ruiz@ctv.es
* HOME: correo@fernando-ruiz.com
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <rtems/shell.h>
int rtems_shell_cat_file(FILE * out,const char * name) {
FILE * fd;
int c;
if (out) {
fd = fopen(name,"r");
if (!fd) {
return -1;
}
while ((c=fgetc(fd))!=EOF)
fputc(c,out);
fclose(fd);
}
return 0;
}