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

Diff for /src/usr.bin/cvs/entries.c between version 1.68 and 1.69

version 1.68, 2007/01/24 13:55:11 version 1.69, 2007/01/25 18:56:33
Line 354 
Line 354 
         FILE *fp;          FILE *fp;
         int linenum;          int linenum;
         size_t len;          size_t len;
         char linebuf[128], *tagpath;          char linebuf[128], tagpath[MAXPATHLEN];
   
         if (tagp != NULL)          if (tagp != NULL)
                 *tagp = NULL;                  *tagp = NULL;
Line 365 
Line 365 
         if (nbp != NULL)          if (nbp != NULL)
                 *nbp = 0;                  *nbp = 0;
   
         tagpath = xmalloc(MAXPATHLEN);  
   
         if (cvs_path_cat(dir, CVS_PATH_TAG, tagpath, MAXPATHLEN) >= MAXPATHLEN)          if (cvs_path_cat(dir, CVS_PATH_TAG, tagpath, MAXPATHLEN) >= MAXPATHLEN)
                 goto out;                  return;
   
         if ((fp = fopen(tagpath, "r")) == NULL) {          if ((fp = fopen(tagpath, "r")) == NULL) {
                 if (errno != ENOENT)                  if (errno != ENOENT)
                         cvs_log(LP_NOTICE, "failed to open `%s' : %s", tagpath,                          cvs_log(LP_NOTICE, "failed to open `%s' : %s", tagpath,
                             strerror(errno));                              strerror(errno));
                 goto out;                  return;
         }          }
   
         linenum = 0;          linenum = 0;
Line 413 
Line 411 
                 cvs_log(LP_NOTICE, "failed to read line from `%s'", tagpath);                  cvs_log(LP_NOTICE, "failed to read line from `%s'", tagpath);
   
         (void)fclose(fp);          (void)fclose(fp);
 out:  
         xfree(tagpath);  
 }  }
   
 void  void
 cvs_write_tagfile(char *dir, char *tag, char *date, int nb)  cvs_write_tagfile(char *dir, char *tag, char *date, int nb)
 {  {
         FILE *fp;          FILE *fp;
         char *tagpath;          char tagpath[MAXPATHLEN];
   
         if (cvs_noexec == 1)          if (cvs_noexec == 1)
                 return;                  return;
   
         tagpath = xmalloc(MAXPATHLEN);  
   
         if (cvs_path_cat(dir, CVS_PATH_TAG, tagpath, MAXPATHLEN) >= MAXPATHLEN)          if (cvs_path_cat(dir, CVS_PATH_TAG, tagpath, MAXPATHLEN) >= MAXPATHLEN)
                 goto out;                  return;
   
         if ((tag != NULL) || (date != NULL)) {          if ((tag != NULL) || (date != NULL)) {
                 if ((fp = fopen(tagpath, "w+")) == NULL) {                  if ((fp = fopen(tagpath, "w+")) == NULL) {
Line 437 
Line 431 
                                 cvs_log(LP_NOTICE, "failed to open `%s' : %s",                                  cvs_log(LP_NOTICE, "failed to open `%s' : %s",
                                     tagpath, strerror(errno));                                      tagpath, strerror(errno));
                         }                          }
                         goto out;                          return;
                 }                  }
                 if (tag != NULL) {                  if (tag != NULL) {
                         if (nb != 0)                          if (nb != 0)
Line 450 
Line 444 
                 (void)fclose(fp);                  (void)fclose(fp);
         } else {          } else {
                 (void)cvs_unlink(tagpath);                  (void)cvs_unlink(tagpath);
                 goto out;  
         }          }
 out:  
         xfree(tagpath);  
 }  }

Legend:
Removed from v.1.68  
changed lines
  Added in v.1.69