[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.175 and 1.176

version 1.175, 2007/01/23 01:53:38 version 1.176, 2007/01/25 18:56:33
Line 74 
Line 74 
         int i, l;          int i, l;
         FILE *ifp;          FILE *ifp;
         size_t len;          size_t len;
         char *path, *buf;          char path[MAXPATHLEN], buf[MAXNAMLEN];
   
         path = xmalloc(MAXPATHLEN);  
         buf = xmalloc(MAXNAMLEN);  
   
         TAILQ_INIT(&cvs_ign_pats);          TAILQ_INIT(&cvs_ign_pats);
         TAILQ_INIT(&dir_ign_pats);          TAILQ_INIT(&dir_ign_pats);
   
Line 109 
Line 106 
   
                 (void)fclose(ifp);                  (void)fclose(ifp);
         }          }
   
         xfree(path);  
         xfree(buf);  
 }  }
   
 void  void
Line 207 
Line 201 
 {  {
         int l;          int l;
         struct cvs_file *cf;          struct cvs_file *cf;
         char *p, *rpath;          char *p, rpath[MAXPATHLEN];
   
         rpath = xmalloc(MAXPATHLEN);  
   
         l = snprintf(rpath, MAXPATHLEN, "%s/%s", d, f);          l = snprintf(rpath, MAXPATHLEN, "%s/%s", d, f);
         if (l == -1 || l >= MAXPATHLEN)          if (l == -1 || l >= MAXPATHLEN)
                 fatal("cvs_file_get_cf: overflow");                  fatal("cvs_file_get_cf: overflow");
Line 230 
Line 222 
         cf->file_status = cf->file_flags = 0;          cf->file_status = cf->file_flags = 0;
         cf->file_ent = NULL;          cf->file_ent = NULL;
   
         xfree(rpath);  
         return (cf);          return (cf);
 }  }
   
Line 241 
Line 232 
         struct stat st;          struct stat st;
         struct cvs_file *cf;          struct cvs_file *cf;
         struct cvs_filelist *l, *nxt;          struct cvs_filelist *l, *nxt;
         char *d, *f, *repo, *fpath;          char *d, *f, repo[MAXPATHLEN], fpath[MAXPATHLEN];
   
         fpath = xmalloc(MAXPATHLEN);  
         repo = xmalloc(MAXPATHLEN);  
   
         for (l = TAILQ_FIRST(fl); l != NULL; l = nxt) {          for (l = TAILQ_FIRST(fl); l != NULL; l = nxt) {
                 if (cvs_quit)                  if (cvs_quit)
                         fatal("received signal %d", sig_received);                          fatal("received signal %d", sig_received);
Line 334 
Line 322 
                 xfree(l->file_path);                  xfree(l->file_path);
                 xfree(l);                  xfree(l);
         }          }
   
         xfree(fpath);  
         xfree(repo);  
 }  }
   
 void  void
Line 355 
Line 340 
         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 *buf, *ebuf, *cp, *repo, *fpath;          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 368 
Line 353 
         if (cf->file_status == FILE_SKIP)          if (cf->file_status == FILE_SKIP)
                 return;                  return;
   
         fpath = xmalloc(MAXPATHLEN);  
   
         /*          /*
          * If we do not have a admin directory inside here, dont bother,           * If we do not have a admin directory inside here, dont bother,
          * unless we are running import.           * unless we are running import.
Line 382 
Line 365 
         l = stat(fpath, &st);          l = stat(fpath, &st);
         if (cvs_cmdop != CVS_OP_IMPORT &&          if (cvs_cmdop != CVS_OP_IMPORT &&
             (l == -1 || (l == 0 && !S_ISDIR(st.st_mode)))) {              (l == -1 || (l == 0 && !S_ISDIR(st.st_mode)))) {
                 xfree(fpath);  
                 return;                  return;
         }          }
   
Line 544 
Line 526 
         cvs_ent_close(entlist, ENT_NOSYNC);          cvs_ent_close(entlist, ENT_NOSYNC);
   
         if (cr->flags & CR_REPO) {          if (cr->flags & CR_REPO) {
                 repo = xmalloc(MAXPATHLEN);  
                 cvs_get_repository_path(cf->file_path, repo, MAXPATHLEN);                  cvs_get_repository_path(cf->file_path, repo, MAXPATHLEN);
                 cvs_repository_lock(repo);                  cvs_repository_lock(repo);
   
Line 555 
Line 536 
         cvs_file_walklist(&fl, cr);          cvs_file_walklist(&fl, cr);
         cvs_file_freelist(&fl);          cvs_file_freelist(&fl);
   
         if (cr->flags & CR_REPO) {          if (cr->flags & CR_REPO)
                 cvs_repository_unlock(repo);                  cvs_repository_unlock(repo);
                 xfree(repo);  
         }  
   
         cvs_file_walklist(&dl, cr);          cvs_file_walklist(&dl, cr);
         cvs_file_freelist(&dl);          cvs_file_freelist(&dl);
   
         xfree(fpath);  
   
         if (cr->leavedir != NULL)          if (cr->leavedir != NULL)
                 cr->leavedir(cf);                  cr->leavedir(cf);
 }  }
Line 591 
Line 568 
         int rflags, l, ismodified, rcsdead, verbose;          int rflags, l, ismodified, rcsdead, verbose;
         CVSENTRIES *entlist = NULL;          CVSENTRIES *entlist = NULL;
         const char *state;          const char *state;
         char *repo, *rcsfile, r1[16], r2[16];          char repo[MAXPATHLEN], rcsfile[MAXPATHLEN], r1[16], r2[16];
   
         cvs_log(LP_TRACE, "cvs_file_classify(%s)", cf->file_path);          cvs_log(LP_TRACE, "cvs_file_classify(%s)", cf->file_path);
   
Line 602 
Line 579 
   
         verbose = (verbosity > 1 && loud == 1);          verbose = (verbosity > 1 && loud == 1);
   
         repo = xmalloc(MAXPATHLEN);  
         rcsfile = xmalloc(MAXPATHLEN);  
   
         cvs_get_repository_path(cf->file_wd, repo, MAXPATHLEN);          cvs_get_repository_path(cf->file_wd, repo, MAXPATHLEN);
         l = snprintf(rcsfile, MAXPATHLEN, "%s/%s",          l = snprintf(rcsfile, MAXPATHLEN, "%s/%s",
             repo, cf->file_name);              repo, cf->file_name);
Line 641 
Line 615 
                 else                  else
                         cf->file_status = FILE_UNKNOWN;                          cf->file_status = FILE_UNKNOWN;
   
                 xfree(repo);  
                 xfree(rcsfile);  
                 cvs_ent_close(entlist, ENT_NOSYNC);                  cvs_ent_close(entlist, ENT_NOSYNC);
                 return;                  return;
         }          }
Line 861 
Line 833 
                 }                  }
         }          }
   
         xfree(repo);  
         xfree(rcsfile);  
         cvs_ent_close(entlist, ENT_NOSYNC);          cvs_ent_close(entlist, ENT_NOSYNC);
 }  }
   

Legend:
Removed from v.1.175  
changed lines
  Added in v.1.176