inpcom.c: debug printout to debug-out.txt improved

This commit is contained in:
h_vogt 2013-08-31 10:57:26 +02:00 committed by rlar
parent 21f5fce1f8
commit e7e16e06e7
1 changed files with 11 additions and 0 deletions

View File

@ -845,6 +845,17 @@ inp_readall(FILE *fp, int call_depth, char *dir_name, bool comfile, bool intfile
/*debug: print into file*/
FILE *fd = fopen("debug-out.txt", "w");
struct line *t;
fprintf(fd, "**************** uncommented deck **************\n\n");
/* always print first line */
fprintf(fd, "%d %d %s\n", cc->li_linenum_orig, cc->li_linenum, cc->li_line);
/* here without out-commented lines */
for (t = cc->li_next; t; t = t->li_next) {
if (*(t->li_line) == '*')
continue;
fprintf(fd, "%d %d %s\n", t->li_linenum_orig, t->li_linenum, t->li_line);
}
fprintf(fd, "\n****************** complete deck ***************\n\n");
/* now completely */
for (t = cc; t; t = t->li_next)
fprintf(fd, "%d %d %s\n", t->li_linenum_orig, t->li_linenum, t->li_line);
fclose(fd);