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

Comparing ray/src/common/wordfile.c (file contents):
Revision 2.19 by greg, Wed Mar 23 18:17:46 2016 UTC vs.
Revision 2.21 by greg, Thu May 12 16:30:39 2016 UTC

# Line 38 | Line 38 | wordfile(                      /* get words from fname, put in words */
38                  return(-1);
39          if ((fd = open(fname, 0)) < 0)
40                  return(-1);                     /* open error */
41 +        SET_FD_BINARY(fd);                      /* Windows bug workaround */
42          words[0] = NULL;
43          while (nargs > 1 && (n += read(fd, buf+n, MAXWLEN-n)) > 0) {
44                  int     crem = 0;
45 <                if (n >= MAXWLEN)               /* still something left? */
45 >                if (n > MAXWLEN/2)              /* check for mid-word end */
46                          while (!isspace(buf[--n])) {
47                                  if (n <= 0)     /* one long word! */
48                                          goto done;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines