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

Diff for /src/usr.bin/cvs/file.c between version 1.193 and 1.194

version 1.193, 2007/06/28 21:38:09 version 1.194, 2007/07/03 13:22:42
Line 338 
Line 338 
         struct cvs_ent_line *line;          struct cvs_ent_line *line;
         struct cvs_flisthead fl, dl;          struct cvs_flisthead fl, dl;
         CVSENTRIES *entlist;          CVSENTRIES *entlist;
         char *p, *buf, *ebuf, *cp, repo[MAXPATHLEN], fpath[MAXPATHLEN];          char *buf, *ebuf, *cp, repo[MAXPATHLEN], fpath[MAXPATHLEN];
   
         cvs_log(LP_TRACE, "cvs_file_walkdir(%s)", cf->file_path);          cvs_log(LP_TRACE, "cvs_file_walkdir(%s)", cf->file_path);
   
Line 467 
Line 467 
                                         cvs_file_get(fpath, &dl);                                          cvs_file_get(fpath, &dl);
                                 break;                                  break;
                         case CVS_FILE:                          case CVS_FILE:
                                 if ((p = strrchr(cf->file_path, '/')) &&  
                                     !strcmp(p + 1, CVS_PATH_ATTIC)) {  
   
                                         *p = '\0';  
                                         len = xsnprintf(fpath, MAXPATHLEN,  
                                             "%s/%s", cf->file_path, dp->d_name);  
                                         *p = '/';  
                                 }  
                                 if (fpath[len - 2] == ',' &&  
                                     fpath[len - 1] == 'v')  
                                         fpath[len - 2] = '\0';  
                                 cvs_file_get(fpath, &fl);                                  cvs_file_get(fpath, &fl);
                                 break;                                  break;
                         default:                          default:
Line 563 
Line 552 
         CVSENTRIES *entlist = NULL;          CVSENTRIES *entlist = NULL;
         const char *state;          const char *state;
         char repo[MAXPATHLEN], rcsfile[MAXPATHLEN];          char repo[MAXPATHLEN], rcsfile[MAXPATHLEN];
         char r1[CVS_REV_BUFSZ], r2[CVS_REV_BUFSZ], *tfname, *tpath, *p;          char r1[CVS_REV_BUFSZ], r2[CVS_REV_BUFSZ];
   
         cvs_log(LP_TRACE, "cvs_file_classify(%s)", cf->file_path);          cvs_log(LP_TRACE, "cvs_file_classify(%s)", cf->file_path);
   
Line 572 
Line 561 
                 return;                  return;
         }          }
   
   
         cvs_get_repository_path(cf->file_wd, repo, MAXPATHLEN);          cvs_get_repository_path(cf->file_wd, repo, MAXPATHLEN);
         (void)xsnprintf(rcsfile, MAXPATHLEN, "%s/%s",          (void)xsnprintf(rcsfile, MAXPATHLEN, "%s/%s",
             repo, cf->file_name);              repo, cf->file_name);
Line 584 
Line 572 
         }          }
   
         cf->file_rpath = xstrdup(rcsfile);          cf->file_rpath = xstrdup(rcsfile);
         /* XXX: likely wrong place for this shit */  
         /* is this file in the Attic? */  
         if (cf->file_type == CVS_FILE  
             && strstr(cf->file_rpath, CVS_PATH_ATTIC) != NULL) {  
                 cf->in_attic = 1;  
                 /* chop the 'Attic' out of cf->file_path */  
                 if ((tfname = basename(cf->file_path)) == NULL)  
                         fatal("cvs_file_classify: basename failure");  
                 if ((tpath = dirname(cf->file_path)) == NULL)  
                         fatal("cvs_file_classify: dirname failure");  
                 if ((p = strstr(tpath, CVS_PATH_ATTIC)) == NULL)  
                         fatal("cvs_file_classify: strstr failure");  
                 strlcpy(cf->file_path, tpath, p - tpath + 1);  
                 strlcat(cf->file_path, tfname, MAXPATHLEN);  
         }  
   
         entlist = cvs_ent_open(cf->file_wd);          entlist = cvs_ent_open(cf->file_wd);
         cf->file_ent = cvs_ent_get(entlist, cf->file_name);          cf->file_ent = cvs_ent_get(entlist, cf->file_name);
   
Line 638 
Line 610 
                 break;                  break;
         }          }
   
         if (strncmp(cf->file_path, CVS_JUNK, strlen(CVS_JUNK)) == 0) {  
                 cf->file_status = FILE_UNKNOWN;  
                 return;  
         }  
         cf->repo_fd = open(cf->file_rpath, O_RDONLY);          cf->repo_fd = open(cf->file_rpath, O_RDONLY);
         if (cf->repo_fd != -1) {          if (cf->repo_fd != -1) {
                 cf->file_rcs = rcs_open(cf->file_rpath, cf->repo_fd, rflags);                  cf->file_rcs = rcs_open(cf->file_rpath, cf->repo_fd, rflags);
                 if (cf->file_rcs == NULL)                  if (cf->file_rcs == NULL)
                         fatal("cvs_file_classify: failed to parse RCS");                          fatal("cvs_file_classify: failed to parse RCS");
           } else {
                   (void)xsnprintf(rcsfile, MAXPATHLEN, "%s/%s/%s%s",
                        repo, CVS_PATH_ATTIC, cf->file_name, RCS_FILE_EXT);
   
                   cf->repo_fd = open(rcsfile, O_RDONLY);
                   if (cf->repo_fd != -1) {
                           xfree(cf->file_rpath);
                           cf->file_rpath = xstrdup(rcsfile);
                           cf->file_rcs = rcs_open(cf->file_rpath,
                               cf->repo_fd, rflags);
                           if (cf->file_rcs == NULL)
                                   fatal("cvs_file_classify: failed to parse RCS");
                           cf->in_attic = 1;
                   } else {
                           cf->file_rcs = NULL;
                   }
         }          }
   
         if (tag != NULL && cf->file_rcs != NULL) {          if (tag != NULL && cf->file_rcs != NULL) {
Line 771 
Line 755 
                         }                          }
                 }                  }
         } else if (cf->file_ent->ce_status == CVS_ENT_REG) {          } else if (cf->file_ent->ce_status == CVS_ENT_REG) {
                 if (cf->file_rcs == NULL || rcsdead == 1) {                  if (cf->file_rcs == NULL || rcsdead == 1 ||
                       (reset_stickies == 1 && cf->in_attic == 1)) {
                         if (cf->fd == -1) {                          if (cf->fd == -1) {
                                 cvs_log(LP_NOTICE,                                  cvs_log(LP_NOTICE,
                                     "warning: %s's entry exists but"                                      "warning: %s's entry exists but"

Legend:
Removed from v.1.193  
changed lines
  Added in v.1.194