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

Diff for /src/usr.bin/patch/inp.c between version 1.48 and 1.49

version 1.48, 2018/04/26 12:42:51 version 1.49, 2019/06/28 13:35:02
Line 179 
Line 179 
                 say("block too large to mmap\n");                  say("block too large to mmap\n");
                 return false;                  return false;
         }          }
         if ((ifd = open(filename, O_RDONLY)) < 0)          if ((ifd = open(filename, O_RDONLY)) == -1)
                 pfatal("can't open file %s", filename);                  pfatal("can't open file %s", filename);
   
         if (i_size) {          if (i_size) {
Line 285 
Line 285 
         if ((ifp = fopen(filename, "r")) == NULL)          if ((ifp = fopen(filename, "r")) == NULL)
                 pfatal("can't open file %s", filename);                  pfatal("can't open file %s", filename);
         (void) unlink(TMPINNAME);          (void) unlink(TMPINNAME);
         if ((tifd = open(TMPINNAME, O_EXCL | O_CREAT | O_WRONLY, 0666)) < 0)          if ((tifd = open(TMPINNAME, O_EXCL | O_CREAT | O_WRONLY, 0666)) == -1)
                 pfatal("can't open file %s", TMPINNAME);                  pfatal("can't open file %s", TMPINNAME);
         while ((p = fgetln(ifp, &len)) != NULL) {          while ((p = fgetln(ifp, &len)) != NULL) {
                 if (p[len - 1] == '\n')                  if (p[len - 1] == '\n')
Line 363 
Line 363 
         }          }
         fclose(ifp);          fclose(ifp);
         close(tifd);          close(tifd);
         if ((tifd = open(TMPINNAME, O_RDONLY)) < 0)          if ((tifd = open(TMPINNAME, O_RDONLY)) == -1)
                 pfatal("can't reopen file %s", TMPINNAME);                  pfatal("can't reopen file %s", TMPINNAME);
 }  }
   
Line 394 
Line 394 
                         tiline[whichbuf] = baseline;                          tiline[whichbuf] = baseline;
   
                         if (lseek(tifd, (off_t) (baseline / lines_per_buf *                          if (lseek(tifd, (off_t) (baseline / lines_per_buf *
                             tibuflen), SEEK_SET) < 0)                              tibuflen), SEEK_SET) == -1)
                                 pfatal("cannot seek in the temporary input file");                                  pfatal("cannot seek in the temporary input file");
   
                         if (read(tifd, tibuf[whichbuf], tibuflen)                          if (read(tifd, tibuf[whichbuf], tibuflen)

Legend:
Removed from v.1.48  
changed lines
  Added in v.1.49