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

Diff for /src/usr.bin/sdiff/sdiff.c between version 1.18 and 1.19

version 1.18, 2006/05/10 14:32:51 version 1.19, 2006/05/25 03:20:32
Line 17 
Line 17 
 #include <fcntl.h>  #include <fcntl.h>
 #include <getopt.h>  #include <getopt.h>
 #include <limits.h>  #include <limits.h>
   #include <paths.h>
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
Line 65 
Line 66 
 int      lflag;         /* print only left column for identical lines */  int      lflag;         /* print only left column for identical lines */
 int      sflag;         /* skip identical lines */  int      sflag;         /* skip identical lines */
 FILE    *outfile;       /* file to save changes to */  FILE    *outfile;       /* file to save changes to */
   const char *tmpdir;     /* TMPDIR or /tmp */
   
 static struct option longopts[] = {  static struct option longopts[] = {
         { "text",                       no_argument,            NULL,   'a' },          { "text",                       no_argument,            NULL,   'a' },
Line 117 
Line 119 
         }          }
   
         /* Not a regular file, so copy input into temporary file. */          /* Not a regular file, so copy input into temporary file. */
         target_file = xmktemp(NULL);          if (asprintf(&target_file, "%s/sdiff.XXXXXXXXXX", tmpdir) == -1)
         if ((ofd = open(target_file, O_WRONLY, 0)) == -1) {                  err(2, "asprintf");
           if ((ofd = mkstemp(target_file)) == -1) {
                 warn("error opening %s", target_file);                  warn("error opening %s", target_file);
                 goto FAIL;                  goto FAIL;
         }          }
Line 243 
Line 246 
   
         if (argc != 2)          if (argc != 2)
                 usage();                  usage();
   
           if ((tmpdir = getenv("TMPDIR")) == NULL)
                   tmpdir = _PATH_TMP;
   
         filename1 = argv[0];          filename1 = argv[0];
         filename2 = argv[1];          filename2 = argv[1];

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19