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

Comparing ray/src/gen/xform.c (file contents):
Revision 1.6 by greg, Wed Oct 4 13:09:54 1989 UTC vs.
Revision 1.7 by greg, Wed Oct 4 16:28:14 1989 UTC

# Line 181 | Line 181 | register FILE  *fin;
181                          } while (c != '\n');
182                  } else if (c == '!') {                  /* command */
183                          ungetc(c, fin);
184 <                        if (expand)
185 <                                xfcomm(name, fin);
186 <                        else {
187 <                                putchar('\n');
188 <                                while ((c = getc(fin)) != EOF && c != '\n')
189 <                                        putchar(c);
190 <                                printf(" | %s -e", xav[0]);
191 <                                for (c = 1; c < xac; c++)
192 <                                        printf(" %s", xav[c]);
193 <                                putchar('\n');
194 <                        }
184 >                        xfcomm(name, fin);
185                  } else {                                /* object */
186                          ungetc(c, fin);
187                          xfobject(name, fin);
# Line 200 | Line 190 | register FILE  *fin;
190   }
191  
192  
193 < xfcomm(fname, fin)                              /* expand a command */
193 > xfcomm(fname, fin)                      /* transform a command */
194   FILE  *fin;
195   {
196          FILE  *popen();
197 <        char  *fgets();
197 >        char  *fgetline();
198          FILE  *pin;
199          char  buf[512];
200 +        int  i;
201  
202 <        fgets(buf, sizeof(buf), fin);
203 <        if (buf[strlen(buf)-1] == '\n')
204 <                buf[strlen(buf)-1] = '\0';
205 <        if ((pin = popen(buf+1, "r")) == NULL) {
206 <                fprintf(stderr, "%s: (%s): cannot execute \"%s\"\n",
207 <                                progname, fname, buf);
208 <                exit(1);
202 >        fgetline(buf, sizeof(buf), fin);
203 >        if (expand) {
204 >                if ((pin = popen(buf+1, "r")) == NULL) {
205 >                        fprintf(stderr, "%s: (%s): cannot execute \"%s\"\n",
206 >                                        progname, fname, buf);
207 >                        exit(1);
208 >                }
209 >                xform(buf, pin);
210 >                pclose(pin);
211 >        } else {
212 >                printf("\n%s | %s -e", buf, xav[0]);
213 >                for (i = 1; i < xac; i++)
214 >                        printf(" %s", xav[i]);
215 >                putchar('\n');
216          }
219        xform(buf, pin);
220        pclose(pin);
217   }
218  
219  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines