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

Comparing ray/src/common/header.c (file contents):
Revision 2.27 by greg, Sun Jun 10 02:46:12 2012 UTC vs.
Revision 2.28 by greg, Thu Aug 9 23:15:38 2012 UTC

# Line 182 | Line 182 | formatval(                     /* get format value (return true if forma
182          if (r == NULL) return(1);
183          do
184                  *r++ = *s++;
185 <        while(*s && !isspace(*s));
185 >        while (*s && !isspace(*s));
186          *r = '\0';
187          return(1);
188   }
# Line 213 | Line 213 | getheader(             /* get header from file */
213                  buf[MAXLINE-2] = '\n';
214                  if (fgets(buf, MAXLINE, fp) == NULL)
215                          return(-1);
216 <                if (buf[0] == '\n')
216 >                if (buf[buf[0]=='\r'] == '\n')
217                          return(0);
218                  if (buf[MAXLINE-2] != '\n') {
219                          ungetc(buf[MAXLINE-2], fp);     /* prevent false end */
# Line 262 | Line 262 | globmatch(                     /* check for match of s against pattern p
262                  case '*':                       /* match any string */
263                          while (p[1] == '*') p++;
264                          do
265 <                                if ( (p[1]=='?' || p[1]==*s) &&
265 >                                if ( (p[1]=='?') | (p[1]==*s) &&
266                                                  globmatch(p+1,s) )
267                                          return(1);
268                          while (*s++);
# Line 275 | Line 275 | globmatch(                     /* check for match of s against pattern p
275                                  if (!*p)
276                                          return(0);
277                                  if (*p == '-') {
278 <                                        setmatch += p[-1] <= *s && *s <= p[1];
278 >                                        setmatch += (p[-1] <= *s && *s <= p[1]);
279                                          if (!*++p)
280                                                  break;
281                                  } else
282 <                                        setmatch += *p == *s;
282 >                                        setmatch += (*p == *s);
283                          }
284                          if (!setmatch)
285                                  return(0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines