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

Diff for /src/usr.bin/cvs/commit.c between version 1.63 and 1.64

version 1.63, 2006/05/28 10:15:35 version 1.64, 2006/05/30 04:20:27
Line 150 
Line 150 
 cvs_commit_local(struct cvs_file *cf)  cvs_commit_local(struct cvs_file *cf)
 {  {
         BUF *b;          BUF *b;
         int isadded;          int l, isadded;
         char *d, *f, rbuf[24];          char *d, *f, rbuf[24];
         CVSENTRIES *entlist;          CVSENTRIES *entlist;
           char *attic, *repo;
   
         cvs_log(LP_TRACE, "cvs_commit_local(%s)", cf->file_path);          cvs_log(LP_TRACE, "cvs_commit_local(%s)", cf->file_path);
         cvs_file_classify(cf, 0);          cvs_file_classify(cf, 0);
   
           if (cf->file_type != CVS_FILE)
                   fatal("cvs_commit_local: '%s' is not a file", cf->file_path);
   
         if (cf->file_status == FILE_MODIFIED ||          if (cf->file_status == FILE_MODIFIED ||
             cf->file_status == FILE_REMOVED)              cf->file_status == FILE_REMOVED)
                 rcsnum_tostr(cf->file_rcs->rf_head, rbuf, sizeof(rbuf));                  rcsnum_tostr(cf->file_rcs->rf_head, rbuf, sizeof(rbuf));
Line 248 
Line 252 
                 entlist = cvs_ent_open(cf->file_wd);                  entlist = cvs_ent_open(cf->file_wd);
                 cvs_ent_remove(entlist, cf->file_name);                  cvs_ent_remove(entlist, cf->file_name);
                 cvs_ent_close(entlist, ENT_SYNC);                  cvs_ent_close(entlist, ENT_SYNC);
   
                   repo = xmalloc(MAXPATHLEN);
                   attic = xmalloc(MAXPATHLEN);
                   cvs_get_repository_path(cf->file_wd, repo, MAXPATHLEN);
   
                   l = snprintf(attic, MAXPATHLEN, "%s/%s", repo, CVS_PATH_ATTIC);
                   if (l == -1 || l >= MAXPATHLEN)
                           fatal("cvs_commit_local: overflow");
   
                   if (mkdir(attic, 0755) == -1 && errno != EEXIST)
                           fatal("cvs_commit_local: failed to create Attic");
   
                   l = snprintf(attic, MAXPATHLEN, "%s/%s/%s%s", repo,
                       CVS_PATH_ATTIC, cf->file_name, RCS_FILE_EXT);
                   if (l == -1 || l >= MAXPATHLEN)
                           fatal("cvs_commit_local: overflow");
   
                   if (rename(cf->file_rpath, attic) == -1)
                           fatal("cvs_commit_local: failed to move %s to Attic",
                               cf->file_path);
   
                   xfree(repo);
                   xfree(attic);
         }          }
   
         cvs_printf("done\n");          cvs_printf("done\n");

Legend:
Removed from v.1.63  
changed lines
  Added in v.1.64