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

Diff for /src/usr.bin/rcs/rcsdiff.c between version 1.59 and 1.60

version 1.59, 2006/04/29 05:31:28 version 1.60, 2006/05/04 07:06:58
Line 185 
Line 185 
         int ret, fd;          int ret, fd;
         time_t t;          time_t t;
         struct stat st;          struct stat st;
         char path1[MAXPATHLEN], path2[MAXPATHLEN];          char *path1, *path2;
         BUF *b1, *b2;          BUF *b1, *b2;
         char rbuf[64];          char rbuf[64];
         struct tm *tb;          struct tm *tb;
Line 235 
Line 235 
         tv2[0].tv_sec = t;          tv2[0].tv_sec = t;
         tv2[1].tv_sec = t;          tv2[1].tv_sec = t;
   
         if (strlcpy(path1, rcs_tmpdir, sizeof(path1)) >= sizeof(path1) ||          (void)xasprintf(&path1, "%s/diff1.XXXXXXXXXX", rcs_tmpdir);
             strlcat(path1, "/diff1.XXXXXXXXXX", sizeof(path1)) >= sizeof(path1))  
                 errx(1, "path too long");  
         rcs_buf_write_stmp(b1, path1, 0600);          rcs_buf_write_stmp(b1, path1, 0600);
   
         rcs_buf_free(b1);          rcs_buf_free(b1);
Line 246 
Line 244 
         if (utimes(path1, (const struct timeval *)&tv) < 0)          if (utimes(path1, (const struct timeval *)&tv) < 0)
                 warn("utimes");                  warn("utimes");
   
         if (strlcpy(path2, rcs_tmpdir, sizeof(path2)) >= sizeof(path2) ||          (void)xasprintf(&path2, "%s/diff2.XXXXXXXXXX", rcs_tmpdir);
             strlcat(path2, "/diff2.XXXXXXXXXX", sizeof(path2)) >= sizeof(path2))  
                 errx(1, "path too long");  
         rcs_buf_write_stmp(b2, path2, 0600);          rcs_buf_write_stmp(b2, path2, 0600);
   
         rcs_buf_free(b2);          rcs_buf_free(b2);
Line 267 
Line 263 
                 rcs_buf_free(b1);                  rcs_buf_free(b1);
         if (b2 != NULL)          if (b2 != NULL)
                 rcs_buf_free(b2);                  rcs_buf_free(b2);
           if (path1 != NULL)
                   xfree(path1);
           if (path2 != NULL)
                   xfree(path2);
   
         return (ret);          return (ret);
 }  }
Line 275 
Line 275 
 rcsdiff_rev(RCSFILE *file, RCSNUM *rev1, RCSNUM *rev2)  rcsdiff_rev(RCSFILE *file, RCSNUM *rev1, RCSNUM *rev2)
 {  {
         int ret;          int ret;
         char path1[MAXPATHLEN], path2[MAXPATHLEN];          char *path1, *path2;
         BUF *b1, *b2;          BUF *b1, *b2;
         char rbuf1[64], rbuf2[64];          char rbuf1[64], rbuf2[64];
         struct timeval tv[2], tv2[2];          struct timeval tv[2], tv2[2];
Line 317 
Line 317 
         if (!(flags & QUIET))          if (!(flags & QUIET))
                 fprintf(stderr, "%s -r%s -r%s\n", diffargs, rbuf1, rbuf2);                  fprintf(stderr, "%s -r%s -r%s\n", diffargs, rbuf1, rbuf2);
   
         if (strlcpy(path1, rcs_tmpdir, sizeof(path1)) >= sizeof(path1) ||          (void)xasprintf(&path1, "%s/diff1.XXXXXXXXXX", rcs_tmpdir);
             strlcat(path1, "/diff1.XXXXXXXXXX", sizeof(path1)) >= sizeof(path1))  
                 errx(1, "path too long");  
         rcs_buf_write_stmp(b1, path1, 0600);          rcs_buf_write_stmp(b1, path1, 0600);
   
         rcs_buf_free(b1);          rcs_buf_free(b1);
Line 328 
Line 326 
         if (utimes(path1, (const struct timeval *)&tv) < 0)          if (utimes(path1, (const struct timeval *)&tv) < 0)
                 warn("utimes");                  warn("utimes");
   
         if (strlcpy(path2, rcs_tmpdir, sizeof(path2)) >= sizeof(path2) ||          (void)xasprintf(&path2, "%s/diff2.XXXXXXXXXX", rcs_tmpdir);
             strlcat(path2, "/diff2.XXXXXXXXXX", sizeof(path2)) >= sizeof(path2))  
                 errx(1, "path too long");  
         rcs_buf_write_stmp(b2, path2, 0600);          rcs_buf_write_stmp(b2, path2, 0600);
   
         rcs_buf_free(b2);          rcs_buf_free(b2);
Line 347 
Line 343 
                 rcs_buf_free(b1);                  rcs_buf_free(b1);
         if (b2 != NULL)          if (b2 != NULL)
                 rcs_buf_free(b2);                  rcs_buf_free(b2);
           if (path1 != NULL)
                   xfree(path1);
           if (path2 != NULL)
                   xfree(path2);
   
         return (ret);          return (ret);
 }  }

Legend:
Removed from v.1.59  
changed lines
  Added in v.1.60