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

Diff for /src/usr.bin/cvs/cvs.c between version 1.78 and 1.79

version 1.78, 2005/08/01 19:48:18 version 1.79, 2005/08/03 14:43:08
Line 64 
Line 64 
 char *cvs_rootstr;  char *cvs_rootstr;
 char *cvs_rsh = CVS_RSH_DEFAULT;  char *cvs_rsh = CVS_RSH_DEFAULT;
 char *cvs_editor = CVS_EDITOR_DEFAULT;  char *cvs_editor = CVS_EDITOR_DEFAULT;
 char *cvs_repo_base = NULL;  char *cvs_homedir = NULL;
 char *cvs_msg = NULL;  char *cvs_msg = NULL;
   char *cvs_repo_base = NULL;
   
 /* hierarchy of all the files affected by the command */  /* hierarchy of all the files affected by the command */
 CVSFILE *cvs_files;  CVSFILE *cvs_files;
Line 97 
Line 98 
         char *envstr, *cmd_argv[CVS_CMD_MAXARG], **targv;          char *envstr, *cmd_argv[CVS_CMD_MAXARG], **targv;
         int i, ret, cmd_argc;          int i, ret, cmd_argc;
         struct cvs_cmd *cmdp;          struct cvs_cmd *cmdp;
           struct passwd *pw;
   
         TAILQ_INIT(&cvs_variables);          TAILQ_INIT(&cvs_variables);
   
Line 124 
Line 126 
         if ((envstr = getenv("CVSREAD")) != NULL)          if ((envstr = getenv("CVSREAD")) != NULL)
                 cvs_readonly = 1;                  cvs_readonly = 1;
   
           if ((cvs_homedir = getenv("HOME")) == NULL) {
                   pw = getpwuid(getuid());
                   if (pw == NULL) {
                           cvs_log(LP_NOTICE,
                                   "failed to get user's password entry");
                           exit(1);
                   }
                   cvs_homedir = pw->pw_dir;
           }
   
         ret = cvs_getopt(argc, argv);          ret = cvs_getopt(argc, argv);
   
         argc -= ret;          argc -= ret;
Line 330 
Line 342 
 static void  static void
 cvs_read_rcfile(void)  cvs_read_rcfile(void)
 {  {
         char rcpath[MAXPATHLEN], linebuf[128], *envstr, *home, *lp, *p;          char rcpath[MAXPATHLEN], linebuf[128], *lp, *p;
         int l, linenum = 0;          int l, linenum = 0;
         size_t len;          size_t len;
         struct cvs_cmd *cmdp;          struct cvs_cmd *cmdp;
         struct passwd *pw;  
         FILE *fp;          FILE *fp;
   
         pw = getpwuid(getuid());          l = snprintf(rcpath, sizeof(rcpath), "%s/%s", cvs_homedir, CVS_PATH_RC);
         if (pw == NULL) {  
                 cvs_log(LP_NOTICE, "failed to get user's password entry");  
                 return;  
         }  
   
         if ((envstr = getenv("HOME")) != NULL)  
                 home = envstr;  
         else  
                 home = pw->pw_dir;  
   
         l = snprintf(rcpath, sizeof(rcpath), "%s/%s", home, CVS_PATH_RC);  
         if (l == -1 || l >= (int)sizeof(rcpath)) {          if (l == -1 || l >= (int)sizeof(rcpath)) {
                 errno = ENAMETOOLONG;                  errno = ENAMETOOLONG;
                 cvs_log(LP_ERRNO, "%s", rcpath);                  cvs_log(LP_ERRNO, "%s", rcpath);

Legend:
Removed from v.1.78  
changed lines
  Added in v.1.79