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

Comparing ray/src/common/readobj.c (file contents):
Revision 2.25 by greg, Tue Feb 7 20:28:16 2023 UTC vs.
Revision 2.26 by greg, Sat Dec 7 02:05:30 2024 UTC

# Line 128 | Line 128 | getobject(                             /* read the next object */
128          objp->oname = savqstr(sbuf);
129                                          /* get arguments */
130          if (objp->otype == MOD_ALIAS) {
131 <                OBJECT  alias;
131 >                OBJECT  ref;
132 >                OBJREC  *rfp;
133                  strcpy(sbuf, "EOF");
134                  fgetword(sbuf, MAXSTR, fp);
135 <                if ((alias = modifier(sbuf)) == OVOID) {
135 >                if ((ref = modifier(sbuf)) == OVOID) {
136                          sprintf(errmsg, "(%s): bad reference \"%s\"",
137                                          name, sbuf);
138                          objerror(objp, USER, errmsg);
139 <                }
140 <                if (objp->omod == OALIAS ||
141 <                                objp->omod == objptr(alias)->omod) {
142 <                        objp->omod = alias;
139 >                }                       /* skip pass-thru aliases */
140 >                while ((rfp=objptr(ref))->otype == MOD_ALIAS &&
141 >                                !rfp->oargs.nsargs & (rfp->omod != OVOID))
142 >                        ref = rfp->omod;
143 >
144 >                if ((objp->omod == OALIAS) | (objp->omod == rfp->omod)) {
145 >                        objp->omod = ref;
146                  } else {
147                          objp->oargs.sarg = (char **)malloc(sizeof(char *));
148                          if (objp->oargs.sarg == NULL)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines