inpcom.c, inp_read(), rewrite

This commit is contained in:
rlar 2017-04-22 11:01:41 +02:00
parent be5a4809ae
commit c809e15dc1
1 changed files with 5 additions and 9 deletions

View File

@ -914,10 +914,10 @@ inp_read(FILE *fp, int call_depth, char *dir_name, bool comfile, bool intfile)
tfree(buffer); tfree(buffer);
} /* end while ((buffer = readline(fp)) != NULL) */ } /* end while ((buffer = readline(fp)) != NULL) */
if (!end) /* No stuff here */ if (!cc) /* No stuff here */
{ {
rv . line_number = line_number; rv . line_number = line_number;
rv . cc = NULL; rv . cc = cc;
return rv; return rv;
} }
@ -941,13 +941,9 @@ inp_read(FILE *fp, int call_depth, char *dir_name, bool comfile, bool intfile)
add a terminal ".end" card add a terminal ".end" card
*/ */
if (call_depth == 0 && !comfile) { if (call_depth == 0 && !comfile)
if (found_end == TRUE) { if (found_end == TRUE)
struct line *x = xx_new_line(NULL, copy(".end"), line_number++, line_number_orig++); end = end->li_next = xx_new_line(end->li_next, copy(".end"), line_number++, line_number_orig++);
end->li_next = x;
end = x;
}
}
/* Replace first line with the new title, if available */ /* Replace first line with the new title, if available */
if (call_depth == 0 && !comfile && new_title) { if (call_depth == 0 && !comfile && new_title) {