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

Comparing ray/src/cal/rsplit.c (file contents):
Revision 1.10 by greg, Wed Aug 14 21:00:14 2019 UTC vs.
Revision 1.11 by greg, Thu Nov 7 23:13:12 2019 UTC

# Line 64 | Line 64 | headline(char *s, void *p)
64   static int
65   scanOK(int termc)
66   {
67 +        int     skip_white = (termc == ' ');
68          char    *cp = buf;
69          int     c;
70  
71          while ((c = getchar()) != EOF) {
72 +                if (skip_white && isspace(c))
73 +                        continue;
74 +                skip_white = 0;
75 +                if (c == '\n' && isspace(termc))
76 +                        c = termc;      /* forgiving assumption */
77                  *cp++ = c;
78                  if (cp-buf >= sizeof(buf))
79                          break;
80 <                if (c == termc) {
80 >                if ((termc == ' ') ? isspace(c) : (c == termc)) {
81                          *cp = '\0';
82                          return(cp-buf);
83                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines