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

Comparing ray/src/cv/mgflib/parser.c (file contents):
Revision 1.24 by greg, Tue Mar 18 11:17:24 1997 UTC vs.
Revision 1.27 by greg, Fri Feb 28 20:11:29 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1996 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Parse an MGF file, converting or discarding unsupported entities
6   */
7  
8   #include <stdio.h>
9 + #include <stdlib.h>
10   #include <math.h>
11   #include <ctype.h>
12   #include <string.h>
# Line 237 | Line 235 | char   *fn;
235                  return(MG_OK);
236          }
237                                          /* get name relative to this context */
238 <        if (mg_file != NULL && (cp = strrchr(mg_file->fname, '/')) != NULL) {
238 >        if (fn[0] != '/' && mg_file != NULL &&
239 >                        (cp = strrchr(mg_file->fname, '/')) != NULL) {
240                  strcpy(ctx->fname, mg_file->fname);
241                  strcpy(ctx->fname+(cp-mg_file->fname+1), fn);
242          } else
# Line 266 | Line 265 | void
265   mg_fgetpos(pos)                 /* get current position in input file */
266   register MG_FPOS        *pos;
267   {
269        extern long     ftell();
270
268          pos->fid = mg_file->fid;
269          pos->lineno = mg_file->lineno;
270          pos->offset = ftell(mg_file->fp);
# Line 315 | Line 312 | mg_parse()                     /* parse current input line */
312   {
313          char    abuf[MG_MAXLINE];
314          char    *argv[MG_MAXARGC];
318        int     en;
315          register char   *cp, *cp2, **ap;
316                                          /* copy line, removing escape chars */
317          cp = abuf; cp2 = mg_file->inpline;
# Line 810 | Line 806 | char   **av;
806                  if (rad2 == 0.)
807                          return(MG_EILL);
808          } else if (rad2 != 0.) {
809 <                if (rad1 < 0. ^ rad2 < 0.)
809 >                if ((rad1 < 0.) ^ (rad2 < 0.))
810                          return(MG_EILL);
811          } else {                        /* swap */
812                  C_VERTEX        *cv;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines