--- ray/src/rt/rv2.c 1993/08/26 11:24:04 2.19 +++ ray/src/rt/rv2.c 1994/01/06 15:52:17 2.23 @@ -32,8 +32,10 @@ static char SCCSid[] = "$SunId$ LBL"; extern char *atos(); -extern char rifname[]; /* rad input file name */ +extern FILE *popen(); +extern char rifname[128]; /* rad input file name */ + extern char VersionID[]; extern char *progname; extern char *octname; @@ -200,7 +202,11 @@ char *s; } s = sskip(s); } - if (sscanf(s, "%s", rifname) != 1 && rifname[0] == '\0') { + while (isspace(*s)) + s++; + if (*s) + atos(rifname, sizeof(rifname), s); + else if (rifname[0] == '\0') { error(COMMAND, "no previous rad file"); return; } @@ -231,7 +237,9 @@ char *s; s = sskip(s); else strcat(buf, "1"); - if (sscanf(s, "%s", rifname) != 1 && rifname[0] == '\0') { + if (*s) + atos(rifname, sizeof(rifname), s); + else if (rifname[0] == '\0') { error(COMMAND, "no previous rad file"); return; } @@ -628,8 +636,10 @@ char *s; if (thisray.ro == NULL) (*dev->comout)("ray hit nothing"); else { - sprintf(buf, "ray hit %s %s \"%s\"", - objptr(thisray.ro->omod)->oname, + sprintf(buf, "ray hit %s%s %s \"%s\"", + thisray.rod < 0.0 ? "back of " : "", + thisray.ro->omod == OVOID ? VOIDID : + objptr(thisray.ro->omod)->oname, ofun[thisray.ro->otype].funame, thisray.ro->oname); (*dev->comout)(buf); @@ -662,7 +672,11 @@ char *s; COLR *scanline; int y; - if (sscanf(s, "%s", buf) != 1 && buf[0] == '\0') { + while (isspace(*s)) + s++; + if (*s) + atos(buf, sizeof(buf), s); + else if (buf[0] == '\0') { error(COMMAND, "no file"); return; }