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

Comparing ray/src/util/rad.c (file contents):
Revision 2.9 by greg, Wed May 26 11:37:42 1993 UTC vs.
Revision 2.10 by greg, Thu May 27 17:41:46 1993 UTC

# Line 784 | Line 784 | xferopts(ro)                           /* transfer options if indicated */
784   char    *ro;
785   {
786          int     fd, n;
787 +        register char   *cp;
788          
789          n = strlen(ro);
790          if (n < 2)
791                  return;
792          if (vdef(OPTFILE)) {
793 <                if ((fd = open(vval(OPTFILE), O_WRONLY|O_CREAT|O_TRUNC, 0666)) == -1)
793 >                for (cp = ro; cp[1]; cp++)
794 >                        if (isspace(cp[1]) && cp[2] == '-' && isalpha(cp[3]))
795 >                                *cp = '\n';
796 >                        else
797 >                                *cp = cp[1];
798 >                *cp = '\n';
799 >                fd = open(vval(OPTFILE), O_WRONLY|O_CREAT|O_TRUNC, 0666);
800 >                if (fd < 0 || write(fd, ro, n) != n || close(fd) < 0)
801                          syserr(vval(OPTFILE));
794                if (write(fd, ro+1, n-1) != n-1)
795                        syserr(vval(OPTFILE));
796                write(fd, "\n", 1);
797                close(fd);
802                  sprintf(ro, " \"^%s\"", vval(OPTFILE));
803          }
804   #ifdef MSDOS

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines