/* ******************************************************************* * * * Copyright (c) L-DGO/MIT/JGOFS * * * * * * File : ch.c * * * * Purpose : * * * * Version Number : 1.1a * * * * Revision History : * * * * Date Developer * * ---- --------- * * * * 27 Jul 05 WJS * * Explicitly exit with 0 under normal conditions * * Type main to avoid diagnostic * * include stdlib.h for exit defn * * [begin 1.1a] * * Sat Oct 17 1992 10.00 Glenn Flierl * * * * * ******************************************************************* */ #include #include #include int main(argc,argv) int argc; char *argv[]; { int i,j,j1,ok; char lines[2025]; char *s,*t; char nam[255]; FILE *fil; if((fil=fopen(argv[1],"r+")) == NULL)exit(1); s=lines; while (fgets(s,81,fil) != NULL) s += strlen(s)+1; t=lines; fclose(fil); fil=fopen(argv[1],"w"); /* rewind(fil); */ while(t != s) {ok=1; strcpy(nam,t); j=strcspn(nam,"=")+1; if ( j < (int)strlen(nam)){ for(i=2;i