ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/readwfobj.c
(Generate patch)

Comparing ray/src/common/readwfobj.c (file contents):
Revision 2.4 by greg, Sat May 2 00:12:45 2020 UTC vs.
Revision 2.8 by greg, Wed Feb 10 17:57:28 2021 UTC

# Line 171 | Line 171 | loadOBJ(Scene *sc, const char *fspec)
171          FILE    *fp;
172          char    *argv[MAXARG];
173          int     argc;
174 <        char    buf[256];
174 >        char    buf[1024];
175          int     nstats=0, nunknown=0;
176          int     onfaces;
177          VNDX    ondx;
# Line 276 | Line 276 | loadOBJ(Scene *sc, const char *fspec)
276                          fprintf(stderr, " %8d statements\r", nstats);
277          }
278   #if POPEN_SUPPORT
279 <        if (fspec[0] == '!')
280 <                pclose(fp);
281 <        else
279 >        if (fspec[0] == '!') {
280 >                if (pclose(fp) != 0) {
281 >                        sprintf(errmsg, "Bad return status from: %s", fspec+1);
282 >                        error(USER, errmsg);
283 >                        freeScene(sc);
284 >                        return(NULL);
285 >                }
286 >        } else
287   #endif
288          if (fp != stdin)
289                  fclose(fp);
290 <        sprintf(buf, "%d statements read from \"%s\"", nstats, fspec);
290 >        if (verbose)
291 >                fprintf(stderr, "Read %d statements\n", nstats);
292 >        if (strlen(fspec) < sizeof(buf)-32)
293 >                sprintf(buf, "%d statements read from \"%s\"", nstats, fspec);
294 >        else
295 >                sprintf(buf, "%d statements read from (TOO LONG TO SHOW)", nstats);
296          addComment(sc, buf);
297          if (nunknown) {
298                  sprintf(buf, "\t%d unrecognized", nunknown);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines