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

Diff for /src/usr.bin/cmp/regular.c between version 1.2 and 1.3

version 1.2, 1996/06/26 05:32:06 version 1.3, 1999/08/03 16:02:44
Line 78 
Line 78 
         if (length > SIZE_T_MAX)          if (length > SIZE_T_MAX)
                 return (c_special(fd1, file1, skip1, fd2, file2, skip2));                  return (c_special(fd1, file1, skip1, fd2, file2, skip2));
   
         if ((p1 = (u_char *)mmap(NULL,          if ((p1 = mmap(NULL, (size_t)length, PROT_READ,
             (size_t)length, PROT_READ, 0, fd1, skip1)) == (u_char *)-1)                         MAP_PRIVATE, fd1, skip1)) == (u_char *)-1)
                 err(ERR_EXIT, "%s", file1);                  err(ERR_EXIT, "%s", file1);
         if ((p2 = (u_char *)mmap(NULL,          if ((p2 = mmap(NULL, (size_t)length, PROT_READ,
             (size_t)length, PROT_READ, 0, fd2, skip2)) == (u_char *)-1)                         MAP_PRIVATE, fd2, skip2)) == (u_char *)-1)
                 err(ERR_EXIT, "%s", file2);                  err(ERR_EXIT, "%s", file2);
   
         dfound = 0;          dfound = 0;
         for (byte = line = 1; length--; ++p1, ++p2, ++byte) {          for (byte = line = 1; length--; ++p1, ++p2, ++byte) {
                 if ((ch = *p1) != *p2)                  if ((ch = *p1) != *p2) {
                         if (lflag) {                          if (lflag) {
                                 dfound = 1;                                  dfound = 1;
                                 (void)printf("%6qd %3o %3o\n", byte, ch, *p2);                                  (void)printf("%6qd %3o %3o\n", byte, ch, *p2);
                         } else                          } else
                                 diffmsg(file1, file2, byte, line);                                  diffmsg(file1, file2, byte, line);
                                 /* NOTREACHED */                                  /* NOTREACHED */
                   }
                 if (ch == '\n')                  if (ch == '\n')
                         ++line;                          ++line;
         }          }

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