--- ray/src/ot/readobj2.c 2004/03/27 12:41:45 2.9 +++ ray/src/ot/readobj2.c 2025/04/22 04:45:25 2.13 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: readobj2.c,v 2.9 2004/03/27 12:41:45 schorsch Exp $"; +static const char RCSid[] = "$Id: readobj2.c,v 2.13 2025/04/22 04:45:25 greg Exp $"; #endif /* * readobj2.c - routines for reading in object descriptions. @@ -9,7 +9,7 @@ static const char RCSid[] = "$Id: readobj2.c,v 2.9 200 #include #include "platform.h" -#include "rtprocess.h" +#include "paths.h" #include "rtmath.h" #include "rtio.h" #include "rterror.h" @@ -27,9 +27,8 @@ readobj2( /* read in an object file or stream */ ro_cbfunc callback ) { - char *fgetline(); FILE *infp; - char buf[512]; + char buf[2048]; register int c; if (input == NULL) { @@ -58,9 +57,12 @@ readobj2( /* read in an object file or stream */ getobject2(input, infp, callback); } } - if (input[0] == '!') - pclose(infp); - else + if (input[0] == '!') { + if (pclose(infp) != 0) { + sprintf(errmsg, "bad status from \"%s\"", input); + error(SYSTEM, errmsg); + } + } else fclose(infp); }