[BACK]Return to eval.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / m4

Diff for /src/usr.bin/m4/eval.c between version 1.2 and 1.3

version 1.2, 1996/01/15 01:12:11 version 1.3, 1996/06/25 20:50:07
Line 51 
Line 51 
  */   */
   
 #include <sys/types.h>  #include <sys/types.h>
   #include <sys/file.h>
 #include <errno.h>  #include <errno.h>
 #include <unistd.h>  #include <unistd.h>
 #include <stdio.h>  #include <stdio.h>
Line 663 
Line 664 
 dodiv(n)  dodiv(n)
 register int n;  register int n;
 {  {
           int fd;
   
         if (n < 0 || n >= MAXOUT)          if (n < 0 || n >= MAXOUT)
                 n = 0;                 /* bitbucket */                  n = 0;                 /* bitbucket */
         if (outfile[n] == NULL) {          if (outfile[n] == NULL) {
                 m4temp[UNIQUE] = n + '0';                  m4temp[UNIQUE] = n + '0';
                 if ((outfile[n] = fopen(m4temp, "w")) == NULL)                  if ((fd = open(m4temp, O_RDWR|O_EXCL|O_CREAT, 0666)) == -1 ||
                       (outfile[n] = fdopen(fd, "w")) == NULL) {
                           if (fd != -1)
                                   close(fd);
                         oops("%s: cannot divert.", m4temp);                          oops("%s: cannot divert.", m4temp);
                   }
         }          }
         oindex = n;          oindex = n;
         active = outfile[n];          active = outfile[n];

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3