.lib error messages

This commit is contained in:
h_vogt 2011-12-27 08:46:19 +00:00
parent 75767fcc3d
commit b32f935e8b
2 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,6 @@
2011-12-27 Holger Vogt
* inpcom.c: warnings and error messages in .lib handling (bug no. 3111261)
2011-12-26 Holger Vogt 2011-12-26 Holger Vogt
* xpressn.c * xpressn.c
* ptfuncs.c, inpptree.c, inpptree.h, spicelib/parser/inp.h * ptfuncs.c, inpptree.c, inpptree.h, spicelib/parser/inp.h

View File

@ -257,12 +257,13 @@ inp_readall(FILE *fp, struct line **data, int call_depth, char *dir_name, bool c
if ( !*s ) { /* if at end of line, error */ if ( !*s ) { /* if at end of line, error */
fprintf(cp_err, "Error: .lib filename missing\n"); fprintf(cp_err, "Error: .lib filename missing\n");
tfree(buffer); /* was allocated by readline() */ tfree(buffer); /* was allocated by readline() */
continue; controlled_exit(EXIT_FAILURE);
} /* Now s points to first char after .lib */ } /* Now s points to first char after .lib */
for ( t = s; *t && !isspace(*t) && !isquote(*t); t++ ) /* skip to end of word */ for ( t = s; *t && !isspace(*t) && !isquote(*t); t++ ) /* skip to end of word */
; ;
y = t; y = t;
while ( isspace(*y) || isquote(*y) ) y++; /* advance past space chars */ while ( isspace(*y) || isquote(*y) ) y++; /* advance past space chars */
// check if rest of line commented out // check if rest of line commented out
if ( *y && *y != '$' ) { /* .lib <file name> <lib name> */ if ( *y && *y != '$' ) { /* .lib <file name> <lib name> */
for ( z = y; *z && !isspace(*z) && !isquote(*z); z++ ) for ( z = y; *z && !isspace(*z) && !isquote(*z); z++ )
@ -322,7 +323,12 @@ inp_readall(FILE *fp, struct line **data, int call_depth, char *dir_name, bool c
/* Make the .lib a comment */ /* Make the .lib a comment */
*buffer = '*'; *buffer = '*';
} else { /* no lib name given */
fprintf(cp_err, "Warning: library name missing in line\n %s", buffer);
fprintf(cp_err, " File included as: .inc %s\n", s);
memcpy(buffer, ".inc",4);
} }
} /* end of .lib handling */ } /* end of .lib handling */
/* now handle .include statements */ /* now handle .include statements */