This will cause a crash later on if the memory doesn't happen to already contain zero. --- z33.c~ Sun May 9 08:52:39 1999 +++ z33.c Mon May 17 01:53:03 1999 @@ -521,6 +521,8 @@ OBJECT DbLoad(OBJECT stem, int fpath, BO } if( fp == null ) { debug1(DBS, DD, "] DbLoad returning (empty) %s", string(db)); + db_filep(db) = null; + db_lines(db) = (LINE *) NULL; ifdebug(DPP, D, ProfileOff("DbLoad")); return db; } Close input file in SortFile. This is not only a small fd leak, but it also prevents .lix file from being removed on Windows because of sharing violation. --- z45.c~ Sun May 16 03:26:15 1999 +++ z45.c Mon May 17 00:02:00 1999 @@ -231,6 +231,7 @@ void SortFile(FULL_CHAR *infile, FULL_CH /* read lines, sort them, and write them out again sorted */ lines = ReadLines(in_fp, infile, (FULL_CHAR *) NULL, &lines_len); + fclose(in_fp); SortLines(lines, lines_len); WriteLines(out_fp, lines, lines_len); fclose(out_fp); Added necessary ANSI includes (it's strange gcc keeps silence, I guess it has prototypes for these functions predeclared). Updated standalone header to include cprint separately instead of using oboslete cdoc. Replaced the final exit in main with return to keep less sophisticated compilers happy. Version string bumped accordingly. --- c2lout.c~ Sun Mar 28 10:40:18 1999 +++ c2lout.c Mon May 17 00:06:42 1999 @@ -23,9 +23,11 @@ /* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* */ /*****************************************************************************/ +#include +#include #include -#define C2LOUT_VERSION "c2lout Version 3.11 (December 1996)" +#define C2LOUT_VERSION "c2lout Version 3.15 (May 1999)" #define BOOLEAN unsigned #define FALSE 0 #define TRUE 1 @@ -372,7 +374,7 @@ int main(int argc, char *argv[]) else if( at_least_one_file ) fprintf(out_fp == NULL ? stdout : out_fp, "@End @Text\n"); - exit(0); + return 0; } /* end main */ @@ -442,7 +444,8 @@ void ProcessStandAlone(char *fname, FILE /* now print the initial @Use clauses etc.*/ - fprintf(out_fp, "@SysInclude { cdoc }\n"); + fprintf(out_fp, "@SysInclude { cprint }\n"); + fprintf(out_fp, "@SysInclude { doc }\n"); fprintf(out_fp, "@Use { @CP\n"); fprintf(out_fp, " style { %s }\n", style_str); fprintf(out_fp, " font { %s }\n", font_str);