diff --git a/ChangeLog b/ChangeLog index 72a0501e6..8b3d7dd05 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2010-07-02 Holger Vogt + * src/frontend/inpcom.c : .TITLE line added + 2010-07-01 Holger Vogt * src/frontend/inpcom.c : no removal of white spaces in echo lines inside a control section diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 88aac8f1b..91dc917ab 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1064,7 +1064,7 @@ inp_readall(FILE *fp, struct line **data, int call_depth, char *dir_name, bool c int ipc_len; #endif char *copys=NULL, big_buff2[5000]; -/* char *global_copy = NULL; */ + char *new_title = NULL; char keep_char; int line_number = 1; /* sjb - renamed to avoid confusion with struct line */ int line_number_orig = 1, line_number_lib = 1, line_number_inc = 1; @@ -1160,6 +1160,17 @@ inp_readall(FILE *fp, struct line **data, int call_depth, char *dir_name, bool c break; } + /* now handle .title statement */ + if (ciprefix(".title", buffer)) { + for ( s = buffer; *s && !isspace(*s); s++ ); /* skip over .title */ + while ( isspace(*s) ) s++; /* advance past space chars */ + + /* only the last title line remains valid */ + if (new_title != NULL) tfree(new_title); + new_title = copy(s); + *buffer = '*'; /* change .TITLE line to comment line */ + } + /* now handle .lib statements */ if (ciprefix(".lib", buffer)) { for ( s = buffer; *s && !isspace(*s); s++ ); /* skip over .lib */ @@ -1489,6 +1500,12 @@ inp_readall(FILE *fp, struct line **data, int call_depth, char *dir_name, bool c } } + /* Replace first line with the new title, if available */ + if (new_title != NULL) { + if (cc->li_line) tfree(cc->li_line); + cc->li_line = new_title; + } + /* Now clean up li: remove comments & stitch together continuation lines. */ working = cc->li_next; /* cc points to head of deck. Start with the next card. */