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

Diff for /src/usr.bin/cvs/client.c between version 1.49 and 1.50

version 1.49, 2007/01/18 16:45:52 version 1.50, 2007/01/25 18:56:33
Line 365 
Line 365 
 {  {
         struct stat st;          struct stat st;
         int nb;          int nb;
         char *d, *date, *fpath, *repo, *tag;          char *d, *date, fpath[MAXPATHLEN], repo[MAXPATHLEN], *tag;
   
         d = NULL;          d = NULL;
   
         if (lastdir != NULL && !strcmp(dir, lastdir))          if (lastdir != NULL && !strcmp(dir, lastdir))
                 return;                  return;
   
         repo = xmalloc(MAXPATHLEN);  
         cvs_get_repository_path(dir, repo, MAXPATHLEN);          cvs_get_repository_path(dir, repo, MAXPATHLEN);
   
         cvs_client_send_request("Directory %s\n%s", dir, repo);          cvs_client_send_request("Directory %s\n%s", dir, repo);
   
         xfree(repo);  
   
         fpath = xmalloc(MAXPATHLEN);  
         if (cvs_path_cat(dir, CVS_PATH_STATICENTRIES, fpath, MAXPATHLEN) >=          if (cvs_path_cat(dir, CVS_PATH_STATICENTRIES, fpath, MAXPATHLEN) >=
             MAXPATHLEN)              MAXPATHLEN)
                 fatal("cvs_client_senddir: truncation");                  fatal("cvs_client_senddir: truncation");
Line 387 
Line 383 
         if (stat(fpath, &st) == 0 && (st.st_mode & (S_IRUSR|S_IRGRP|S_IROTH)))          if (stat(fpath, &st) == 0 && (st.st_mode & (S_IRUSR|S_IRGRP|S_IROTH)))
                 cvs_client_send_request("Static-directory");                  cvs_client_send_request("Static-directory");
   
         xfree(fpath);  
   
         d = xstrdup(dir);          d = xstrdup(dir);
         cvs_parse_tagfile(d, &tag, &date, &nb);          cvs_parse_tagfile(d, &tag, &date, &nb);
   
Line 619 
Line 613 
         struct cvs_ent *e;          struct cvs_ent *e;
         const char *errstr;          const char *errstr;
         struct timeval tv[2];          struct timeval tv[2];
         char timebuf[32], *repo, *rpath, *entry, *mode;          char timebuf[32], repo[MAXPATHLEN], *rpath, *entry, *mode;
         char revbuf[32], *len, *fpath, *wdir;          char revbuf[32], *len, *fpath, *wdir;
   
         client_check_directory(data);          client_check_directory(data);
Line 629 
Line 623 
         mode = cvs_remote_input();          mode = cvs_remote_input();
         len = cvs_remote_input();          len = cvs_remote_input();
   
         repo = xmalloc(MAXPATHLEN);  
         cvs_get_repository_path(".", repo, MAXPATHLEN);          cvs_get_repository_path(".", repo, MAXPATHLEN);
   
         STRIP_SLASH(repo);          STRIP_SLASH(repo);
Line 640 
Line 633 
         fpath = rpath + strlen(repo) + 1;          fpath = rpath + strlen(repo) + 1;
         if ((wdir = dirname(fpath)) == NULL)          if ((wdir = dirname(fpath)) == NULL)
                 fatal("cvs_client_updated: dirname: %s", strerror(errno));                  fatal("cvs_client_updated: dirname: %s", strerror(errno));
         xfree(repo);  
   
         flen = strtonum(len, 0, INT_MAX, &errstr);          flen = strtonum(len, 0, INT_MAX, &errstr);
         if (errstr != NULL)          if (errstr != NULL)
Line 729 
Line 721 
 cvs_client_set_static_directory(char *data)  cvs_client_set_static_directory(char *data)
 {  {
         FILE *fp;          FILE *fp;
         char *dir, *fpath;          char *dir, fpath[MAXPATHLEN];
   
         if (cvs_cmdop == CVS_OP_EXPORT)          if (cvs_cmdop == CVS_OP_EXPORT)
                 return;                  return;
Line 739 
Line 731 
         dir = cvs_remote_input();          dir = cvs_remote_input();
         xfree(dir);          xfree(dir);
   
         fpath = xmalloc(MAXPATHLEN);  
         if (cvs_path_cat(data, CVS_PATH_STATICENTRIES, fpath, MAXPATHLEN) >=          if (cvs_path_cat(data, CVS_PATH_STATICENTRIES, fpath, MAXPATHLEN) >=
             MAXPATHLEN)              MAXPATHLEN)
                 fatal("cvs_client_set_static_directory: truncation");                  fatal("cvs_client_set_static_directory: truncation");
   
         if ((fp = fopen(fpath, "w+")) == NULL) {          if ((fp = fopen(fpath, "w+")) == NULL) {
                 cvs_log(LP_ERRNO, "%s", fpath);                  cvs_log(LP_ERRNO, "%s", fpath);
                 goto out;                  return;
         }          }
         (void)fclose(fp);          (void)fclose(fp);
 out:  
         xfree(fpath);  
 }  }
   
 void  void
 cvs_client_clear_static_directory(char *data)  cvs_client_clear_static_directory(char *data)
 {  {
         char *dir, *fpath;          char *dir, fpath[MAXPATHLEN];
   
         if (cvs_cmdop == CVS_OP_EXPORT)          if (cvs_cmdop == CVS_OP_EXPORT)
                 return;                  return;
Line 766 
Line 755 
         dir = cvs_remote_input();          dir = cvs_remote_input();
         xfree(dir);          xfree(dir);
   
         fpath = xmalloc(MAXPATHLEN);  
         if (cvs_path_cat(data, CVS_PATH_STATICENTRIES, fpath, MAXPATHLEN) >=          if (cvs_path_cat(data, CVS_PATH_STATICENTRIES, fpath, MAXPATHLEN) >=
             MAXPATHLEN)              MAXPATHLEN)
                 fatal("cvs_client_clear_static_directory: truncation");                  fatal("cvs_client_clear_static_directory: truncation");
   
         (void)cvs_unlink(fpath);          (void)cvs_unlink(fpath);
   
         xfree(fpath);  
 }  }
   
 void  void
 cvs_client_set_sticky(char *data)  cvs_client_set_sticky(char *data)
 {  {
         FILE *fp;          FILE *fp;
         char *dir, *tag, *tagpath;          char *dir, *tag, tagpath[MAXPATHLEN];
   
         if (cvs_cmdop == CVS_OP_EXPORT)          if (cvs_cmdop == CVS_OP_EXPORT)
                 return;                  return;
Line 791 
Line 777 
         xfree(dir);          xfree(dir);
         tag = cvs_remote_input();          tag = cvs_remote_input();
   
         tagpath = xmalloc(MAXPATHLEN);  
         if (cvs_path_cat(data, CVS_PATH_TAG, tagpath, MAXPATHLEN) >= MAXPATHLEN)          if (cvs_path_cat(data, CVS_PATH_TAG, tagpath, MAXPATHLEN) >= MAXPATHLEN)
                 fatal("cvs_client_clear_sticky: truncation");                  fatal("cvs_client_clear_sticky: truncation");
   
Line 803 
Line 788 
         (void)fprintf(fp, "%s\n", tag);          (void)fprintf(fp, "%s\n", tag);
         (void)fclose(fp);          (void)fclose(fp);
 out:  out:
         xfree(tagpath);  
         xfree(tag);          xfree(tag);
 }  }
   
 void  void
 cvs_client_clear_sticky(char *data)  cvs_client_clear_sticky(char *data)
 {  {
         char *dir, *tagpath;          char *dir, tagpath[MAXPATHLEN];
   
         if (cvs_cmdop == CVS_OP_EXPORT)          if (cvs_cmdop == CVS_OP_EXPORT)
                 return;                  return;
Line 820 
Line 804 
         dir = cvs_remote_input();          dir = cvs_remote_input();
         xfree(dir);          xfree(dir);
   
         tagpath = xmalloc(MAXPATHLEN);  
         if (cvs_path_cat(data, CVS_PATH_TAG, tagpath, MAXPATHLEN) >= MAXPATHLEN)          if (cvs_path_cat(data, CVS_PATH_TAG, tagpath, MAXPATHLEN) >= MAXPATHLEN)
                 fatal("cvs_client_clear_sticky: truncation");                  fatal("cvs_client_clear_sticky: truncation");
   
         (void)cvs_unlink(tagpath);          (void)cvs_unlink(tagpath);
   
         xfree(tagpath);  
 }  }
   
   

Legend:
Removed from v.1.49  
changed lines
  Added in v.1.50