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

Diff for /src/usr.bin/cmp/cmp.c between version 1.7 and 1.8

version 1.7, 1998/01/21 22:16:32 version 1.8, 1999/08/03 16:02:44
Line 89 
Line 89 
                 default:                  default:
                         usage();                          usage();
                 }                  }
 endargs:  
         argv += optind;          argv += optind;
         argc -= optind;          argc -= optind;
   
Line 113 
Line 113 
                         err(ERR_EXIT, "%s", file1);                          err(ERR_EXIT, "%s", file1);
         }          }
         if (strcmp(file2 = argv[1], "-") == 0) {          if (strcmp(file2 = argv[1], "-") == 0) {
                 if (special)                  if (special) {
                         if (sflag)                          if (sflag)
                                 exit(ERR_EXIT);                                  exit(ERR_EXIT);
                         else                          else
                                 errx(ERR_EXIT,                                  errx(ERR_EXIT,
                                         "standard input may only be specified once");                                          "standard input may only be specified once");
                   }
                 special = 1;                  special = 1;
                 fd2 = 0;                  fd2 = 0;
                 file2 = "stdin";                  file2 = "stdin";
         }          }
         else if ((fd2 = open(file2, O_RDONLY, 0)) < 0)          else if ((fd2 = open(file2, O_RDONLY, 0)) < 0) {
                 if (sflag)                  if (sflag)
                         exit(ERR_EXIT);                          exit(ERR_EXIT);
                 else                  else
                         err(ERR_EXIT, "%s", file2);                          err(ERR_EXIT, "%s", file2);
           }
   
         skip1 = argc > 2 ? strtoq(argv[2], NULL, 0) : 0;          skip1 = argc > 2 ? strtoq(argv[2], NULL, 0) : 0;
         skip2 = argc == 4 ? strtoq(argv[3], NULL, 0) : 0;          skip2 = argc == 4 ? strtoq(argv[3], NULL, 0) : 0;
   
         if (!special) {          if (!special) {
                 if (fstat(fd1, &sb1))                  if (fstat(fd1, &sb1)) {
                         if (sflag)                          if (sflag)
                                 exit(ERR_EXIT);                                  exit(ERR_EXIT);
                         else                          else
                                 err(ERR_EXIT, "%s", file1);                                  err(ERR_EXIT, "%s", file1);
                   }
                 if (!S_ISREG(sb1.st_mode))                  if (!S_ISREG(sb1.st_mode))
                         special = 1;                          special = 1;
                 else {                  else {
                         if (fstat(fd2, &sb2))                          if (fstat(fd2, &sb2)) {
                                 if (sflag)                                  if (sflag)
                                         exit(ERR_EXIT);                                          exit(ERR_EXIT);
                                 else                                  else
                                         err(ERR_EXIT, "%s", file2);                                          err(ERR_EXIT, "%s", file2);
                           }
                         if (!S_ISREG(sb2.st_mode))                          if (!S_ISREG(sb2.st_mode))
                                 special = 1;                                  special = 1;
                 }                  }

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8