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.3 by greg, Sat Oct 17 08:08:02 1992 UTC vs.
Revision 2.5 by greg, Tue Nov 10 18:21:26 1992 UTC

# Line 55 | Line 55 | char   *str;
55          if (cp == NULL)                 /* ENOMEM */
56                  return(-1);
57          strcpy(cp, str);
58 <        for (ap = avl; *cp; *cp++ = '\0') {
59 <                while (isspace(*cp))    /* skip leading space */
58 >        ap = avl;               /* parse into words */
59 >        for ( ; ; ) {
60 >                while (isspace(*cp))    /* nullify spaces */
61 >                        *cp++ = '\0';
62 >                if (!*cp)               /* all done? */
63 >                        break;
64 >                *ap++ = cp;             /* add argument to list */
65 >                while (*cp && !isspace(*cp))
66                          cp++;
61                if (*cp) {              /* add argument to list */
62                        *ap++ = cp;
63                        while (*cp && !isspace(*cp))
64                                cp++;
65                }
67          }
68          *ap = NULL;
69          return(ap - avl);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines