Browse Source

bug fix, preserve filename case for `codemodel', `load' and `use'

reported and fixed by Emil Lambrache on the bug tracker
http://sourceforge.net/p/ngspice/bugs/241/
  "#241 case sensitivity not preserved for file names"
pre-master-46
rlar 13 years ago
parent
commit
dc0fbe4220
  1. 19
      src/frontend/inpcom.c

19
src/frontend/inpcom.c

@ -617,10 +617,23 @@ inp_readall(FILE *fp, int call_depth, char *dir_name, bool comfile, bool intfile
/* loop through 'buffer' until end is reached. Then test for /* loop through 'buffer' until end is reached. Then test for
premature end. If premature end is reached, spew premature end. If premature end is reached, spew
error and zap the line. */ error and zap the line. */
if (!ciprefix("write", buffer)) { // exclude 'write' command so filename case preserved
{
char *s; char *s;
for (s = buffer; *s && (*s != '\n'); s++)
*s = (char) tolower(*s);
if ( !ciprefix("write", buffer) &&
!ciprefix("codemodel", buffer) &&
!ciprefix("use", buffer) &&
!ciprefix("load", buffer)
)
{
for (s = buffer; *s && (*s != '\n'); s++)
*s = (char) tolower(*s);
} else {
// exclude some commands to preserve filename case
for (s = buffer; *s && (*s != '\n'); s++)
;
}
if (!*s) { if (!*s) {
// fprintf(cp_err, "Warning: premature EOF\n"); // fprintf(cp_err, "Warning: premature EOF\n");
} }

Loading…
Cancel
Save