main.c, shrink scope

This commit is contained in:
rlar 2011-07-02 15:25:32 +00:00
parent 7517419402
commit 3c8a18a93b
1 changed files with 4 additions and 7 deletions

View File

@ -1182,20 +1182,17 @@ bot:
}
while (optind < argc) {
char *arg;
char *arg = argv[optind++];
FILE *tp;
/* Copy all the arguments into the temporary file */
arg = argv[optind++];
tp = fopen(arg, "r");
if (!tp) {
char *lbuffer, *p;
lbuffer = getenv("NGSPICE_INPUT");
// fprintf(stdout, "Such-Dir %s\n", lbuffer);
char *lbuffer = getenv("NGSPICE_INPUT");
if (lbuffer && *lbuffer) {
p = TMALLOC(char, strlen(lbuffer) + strlen(DIR_PATHSEP) + strlen(arg) + 1);
char *p =
TMALLOC(char, strlen(lbuffer) + strlen(DIR_PATHSEP) + strlen(arg) + 1);
sprintf(p, "%s%s%s", lbuffer, DIR_PATHSEP, arg);
// fprintf(stdout, "Suchpfad %s\n", p);
tp = fopen(p, "r");
tfree(p);
}