Browse Source

Formatting

pre-master-46
Jim Monte 6 years ago
committed by Holger Vogt
parent
commit
082f36e794
  1. 15
      src/frontend/inp.c

15
src/frontend/inp.c

@ -522,14 +522,14 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile)
} }
} }
endTime = seconds(); endTime = seconds();
/* store input directory to a variable*/
/* store input directory to a variable */
if (fp) { if (fp) {
cp_vset("inputdir", CP_STRING, dir_name); cp_vset("inputdir", CP_STRING, dir_name);
} }
tfree(dir_name); tfree(dir_name);
/* if nothing came back from inp_readall, e.g. after calling ngspice without parameters, /* if nothing came back from inp_readall, e.g. after calling ngspice without parameters,
just close fp and return to caller */
just close fp and return to caller */
if (!deck) { if (!deck) {
if (!intfile && fp) if (!intfile && fp)
fclose(fp); fclose(fp);
@ -550,11 +550,13 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile)
/* Save the title before INPgetTitle gets it. */ /* Save the title before INPgetTitle gets it. */
tt = copy(deck->line); tt = copy(deck->line);
if (!deck->nextcard)
if (!deck->nextcard) {
fprintf(cp_err, "Warning: no lines in input\n"); fprintf(cp_err, "Warning: no lines in input\n");
}
} }
if (fp && !intfile)
if (fp && !intfile) {
fclose(fp); fclose(fp);
}
/* Now save the IO context and start a new control set. After we /* Now save the IO context and start a new control set. After we
are done with the source we'll put the old file descriptors are done with the source we'll put the old file descriptors
@ -600,14 +602,15 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile)
ft_dotsaves(); ft_dotsaves();
} /* end if (comfile) */ } /* end if (comfile) */
else { /* must be regular deck . . . . */
else { /* must be regular deck . . . . */
/* loop through deck and handle control cards */ /* loop through deck and handle control cards */
for (dd = deck->nextcard; dd; dd = ld->nextcard) { for (dd = deck->nextcard; dd; dd = ld->nextcard) {
/* get temp from deck */ /* get temp from deck */
if (ciprefix(".temp", dd->line)) { if (ciprefix(".temp", dd->line)) {
s = skip_ws(dd->line + 5); s = skip_ws(dd->line + 5);
if (temperature)
if (temperature) {
txfree(temperature); txfree(temperature);
}
temperature = copy(s); temperature = copy(s);
} }
/* Ignore comment lines, but not lines begining with '*#', /* Ignore comment lines, but not lines begining with '*#',

Loading…
Cancel
Save