[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.97 and 1.98

version 1.97, 2008/02/03 15:57:25 version 1.98, 2008/02/03 17:20:14
Line 108 
Line 108 
         { "",                   -1,     NULL, 0 }          { "",                   -1,     NULL, 0 }
 };  };
   
 static void      client_check_directory(char *);  static void      client_check_directory(char *, char *);
 static char     *client_get_supported_responses(void);  static char     *client_get_supported_responses(void);
 static char     *lastdir = NULL;  static char     *lastdir = NULL;
 static int       end_of_response = 0;  static int       end_of_response = 0;
Line 153 
Line 153 
 }  }
   
 static void  static void
 client_check_directory(char *data)  client_check_directory(char *data, char *repository)
 {  {
         CVSENTRIES *entlist;          CVSENTRIES *entlist;
         char entry[CVS_ENT_MAXLINELEN], *parent, *base;          char entry[CVS_ENT_MAXLINELEN], *parent, *base, *p;
   
         STRIP_SLASH(data);          STRIP_SLASH(data);
   
           /* first directory we get is our module root */
           if (module_repo_root == NULL) {
                   p = repository + strlen(current_cvsroot->cr_dir) + 1;
                   module_repo_root = xstrdup(p);
                   p = strrchr(module_repo_root, '/');
                   if (p != NULL)
                           *p = '\0';
           }
   
         cvs_mkpath(data, NULL);          cvs_mkpath(data, NULL);
   
         if (cvs_cmdop == CVS_OP_EXPORT)          if (cvs_cmdop == CVS_OP_EXPORT)
Line 658 
Line 667 
         struct timeval tv[2];          struct timeval tv[2];
         char repo[MAXPATHLEN], entry[CVS_ENT_MAXLINELEN];          char repo[MAXPATHLEN], entry[CVS_ENT_MAXLINELEN];
         char timebuf[CVS_TIME_BUFSZ], revbuf[CVS_REV_BUFSZ];          char timebuf[CVS_TIME_BUFSZ], revbuf[CVS_REV_BUFSZ];
         char *en, *mode, *len, *fpath, *rpath, *wdir;          char *en, *mode, *len, *rpath;
         char sticky[CVS_ENT_MAXLINELEN];          char sticky[CVS_ENT_MAXLINELEN], fpath[MAXPATHLEN];
   
         if (data == NULL)          if (data == NULL)
                 fatal("Missing argument for Updated");                  fatal("Missing argument for Updated");
   
         client_check_directory(data);  
   
         rpath = cvs_remote_input();          rpath = cvs_remote_input();
         en = cvs_remote_input();          en = cvs_remote_input();
         mode = cvs_remote_input();          mode = cvs_remote_input();
         len = cvs_remote_input();          len = cvs_remote_input();
   
           client_check_directory(data, rpath);
         cvs_get_repository_path(".", repo, MAXPATHLEN);          cvs_get_repository_path(".", repo, MAXPATHLEN);
   
         STRIP_SLASH(repo);          STRIP_SLASH(repo);
Line 678 
Line 686 
         if (strlen(repo) + 1 > strlen(rpath))          if (strlen(repo) + 1 > strlen(rpath))
                 fatal("received a repository path that is too short");                  fatal("received a repository path that is too short");
   
         fpath = rpath + strlen(repo) + 1;          (void)xsnprintf(fpath, sizeof(fpath), "%s/%s", data,
         if ((wdir = dirname(fpath)) == NULL)              strrchr(rpath, '/'));
                 fatal("cvs_client_updated: dirname: %s", strerror(errno));  
   
         flen = strtonum(len, 0, INT_MAX, &errstr);          flen = strtonum(len, 0, INT_MAX, &errstr);
         if (errstr != NULL)          if (errstr != NULL)
Line 712 
Line 719 
         cvs_ent_free(e);          cvs_ent_free(e);
   
         if (cvs_cmdop != CVS_OP_EXPORT) {          if (cvs_cmdop != CVS_OP_EXPORT) {
                 ent = cvs_ent_open(wdir);                  ent = cvs_ent_open(data);
                 cvs_ent_add(ent, entry);                  cvs_ent_add(ent, entry);
                 cvs_ent_close(ent, ENT_SYNC);                  cvs_ent_close(ent, ENT_SYNC);
         }          }
Line 754 
Line 761 
         if (data == NULL)          if (data == NULL)
                 fatal("Missing argument for Merged");                  fatal("Missing argument for Merged");
   
         client_check_directory(data);  
   
         rpath = cvs_remote_input();          rpath = cvs_remote_input();
         entry = cvs_remote_input();          entry = cvs_remote_input();
         mode = cvs_remote_input();          mode = cvs_remote_input();
         len = cvs_remote_input();          len = cvs_remote_input();
   
           client_check_directory(data, rpath);
   
         repo = xmalloc(MAXPATHLEN);          repo = xmalloc(MAXPATHLEN);
         cvs_get_repository_path(".", repo, MAXPATHLEN);          cvs_get_repository_path(".", repo, MAXPATHLEN);
   
Line 921 
Line 928 
         STRIP_SLASH(data);          STRIP_SLASH(data);
   
         dir = cvs_remote_input();          dir = cvs_remote_input();
         xfree(dir);  
         tag = cvs_remote_input();          tag = cvs_remote_input();
   
         if (cvs_cmdop == CVS_OP_EXPORT)          if (cvs_cmdop == CVS_OP_EXPORT)
                 goto out;                  goto out;
   
         client_check_directory(data);          client_check_directory(data, dir);
   
         (void)xsnprintf(tagpath, MAXPATHLEN, "%s/%s", data, CVS_PATH_TAG);          (void)xsnprintf(tagpath, MAXPATHLEN, "%s/%s", data, CVS_PATH_TAG);
   
Line 940 
Line 946 
         (void)fclose(fp);          (void)fclose(fp);
 out:  out:
         xfree(tag);          xfree(tag);
           xfree(dir);
 }  }
   
 void  void
Line 953 
Line 960 
         STRIP_SLASH(data);          STRIP_SLASH(data);
   
         dir = cvs_remote_input();          dir = cvs_remote_input();
         xfree(dir);  
   
         if (cvs_cmdop == CVS_OP_EXPORT)          if (cvs_cmdop == CVS_OP_EXPORT) {
                   xfree(dir);
                 return;                  return;
           }
   
         client_check_directory(data);          client_check_directory(data, dir);
   
         (void)xsnprintf(tagpath, MAXPATHLEN, "%s/%s", data, CVS_PATH_TAG);          (void)xsnprintf(tagpath, MAXPATHLEN, "%s/%s", data, CVS_PATH_TAG);
         (void)unlink(tagpath);          (void)unlink(tagpath);
   
           xfree(dir);
 }  }
   
   

Legend:
Removed from v.1.97  
changed lines
  Added in v.1.98