[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.12 and 1.13

version 1.12, 1999/09/06 13:10:48 version 1.13, 1999/09/06 13:20:40
Line 56 
Line 56 
 #include <unistd.h>  #include <unistd.h>
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
   #include <stddef.h>
 #include <string.h>  #include <string.h>
 #include <fcntl.h>  #include <fcntl.h>
 #include <err.h>  #include <err.h>
Line 668 
Line 669 
         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';                  char fname[] = _PATH_DIVNAME;
                 if ((fd = open(m4temp, O_CREAT|O_EXCL|O_WRONLY, 0600)) < 0 ||  
                     (outfile[n] = fdopen(fd, "w")) == NULL)                  if ((fd = mkstemp(fname)) < 0 ||
                         err(1, "%s: cannot divert", m4temp);                          (outfile[n] = fdopen(fd, "w+")) == NULL)
                                   err(1, "%s: cannot divert", fname);
                   if (unlink(fname) == -1)
                           err(1, "%s: cannot unlink", fname);
         }          }
         active = outfile[n];          active = outfile[n];
 }  }

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13