--- ray/src/util/rad.c 2023/06/10 15:49:55 2.131 +++ ray/src/util/rad.c 2025/06/07 05:09:46 2.135 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rad.c,v 2.131 2023/06/10 15:49:55 greg Exp $"; +static const char RCSid[] = "$Id: rad.c,v 2.135 2025/06/07 05:09:46 greg Exp $"; #endif /* * Executive program for oconv, rpict and pfilt @@ -14,7 +14,6 @@ static const char RCSid[] = "$Id: rad.c,v 2.131 2023/0 #include "platform.h" #include "rtprocess.h" #include "view.h" -#include "paths.h" #include "vars.h" #if defined(_WIN32) || defined(_WIN64) @@ -131,6 +130,7 @@ char *viewselect = NULL; /* specific view only */ #define DEF_RPICT_PATH "rpict" /* default rpict path */ +#define R_CMDMAX (5*PATH_MAX+512) /* command paths */ char c_oconv[256] = "oconv"; char c_mkillum[256] = "mkillum"; @@ -144,7 +144,6 @@ int overture = 0; /* overture calculation needed */ int children_running = 0; /* set negative in children */ -char *progname; /* global argv[0] */ char *rifname; /* global rad input file name */ char radname[PATH_MAX]; /* root Radiance file name */ @@ -197,8 +196,8 @@ main( char ropts[512]; char popts[64]; int i; - - progname = argv[0]; + /* set global progname */ + fixargv0(argv[0]); /* get options */ for (i = 1; i < argc && argv[i][0] == '-'; i++) switch (argv[i][1]) { @@ -528,7 +527,7 @@ static void oconv(void) /* run oconv and mkillum if necessary */ { static char illumtmp[] = "ilXXXXXX"; - char combuf[PATH_MAX], ocopts[64], mkopts[1024]; + char combuf[R_CMDMAX], ocopts[64], mkopts[1024]; oconvopts(ocopts); /* get options */ if (octreedate < scenedate) { /* check date on original octree */ @@ -1415,7 +1414,7 @@ rvu( /* run rvu with first view */ ) { char *vw; - char combuf[PATH_MAX]; + char combuf[R_CMDMAX]; /* build command */ if (touchonly || (vw = getview(0, NULL)) == NULL) return; @@ -1613,8 +1612,8 @@ rpict( /* run rpict and pfilt for each view */ } else { if (overture) { /* run overture calculation */ sprintf(combuf, - "%s%s %s%s -x 64 -y 64 -ps 1 %s > %s", - c_rpict, rep, vw, opts, + "%s%s %s%s%s -x 64 -y 64 -ps 1 %s > %s", + c_rpict, rep, vw, opts, po, oct1name, overfile); if (!do_rpiece || !next_process(0)) { if (runcom(combuf)) {