Skip to content

Commit

Permalink
fix: eliminated spurious call to fclose() on pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregungory committed Dec 14, 2020
1 parent 8ccadf2 commit b114a93
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/common/readwfobj.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef lint
static const char RCSid[] = "$Id: readwfobj.c,v 2.5 2020/11/16 18:40:53 greg Exp $";
static const char RCSid[] = "$Id: readwfobj.c,v 2.6 2020/12/14 20:07:34 greg Exp $";
#endif
/*
* readobj.c
Expand Down Expand Up @@ -276,11 +276,13 @@ loadOBJ(Scene *sc, const char *fspec)
fprintf(stderr, " %8d statements\r", nstats);
}
#if POPEN_SUPPORT
if (fspec[0] == '!' && pclose(fp) != 0) {
sprintf(errmsg, "Bad return status from: %s", fspec+1);
error(USER, errmsg);
freeScene(sc);
return(NULL);
if (fspec[0] == '!') {
if (pclose(fp) != 0) {
sprintf(errmsg, "Bad return status from: %s", fspec+1);
error(USER, errmsg);
freeScene(sc);
return(NULL);
}
} else
#endif
if (fp != stdin)
Expand Down

0 comments on commit b114a93

Please sign in to comment.