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

Diff for /src/usr.bin/rcs/ci.c between version 1.30 and 1.31

version 1.30, 2005/10/15 21:33:21 version 1.31, 2005/10/15 23:44:58
Line 58 
Line 58 
 {  {
         fprintf(stderr,          fprintf(stderr,
             "usage: ci [-jMNqV] [-d[date]] [-f[rev]] [-kmode] [-l[rev]]\n"              "usage: ci [-jMNqV] [-d[date]] [-f[rev]] [-kmode] [-l[rev]]\n"
             "          [-mmsg] [-r[rev]] [-u[rev]] file ...\n");              "          [-mmsg] [-r[rev]] [-u[rev]] [-wusername] file ...\n");
 }  }
   
 /*  /*
Line 83 
Line 83 
         date = DATE_NOW;          date = DATE_NOW;
         flags = RCS_RDWR;          flags = RCS_RDWR;
         file = NULL;          file = NULL;
         rcs_msg = NULL;          rcs_msg = username = NULL;
         newrev =  NULL;          newrev =  NULL;
         fmode = force = lkmode = verbose = rflag = status = 0;          fmode = force = lkmode = verbose = rflag = status = 0;
         interactive = 1;          interactive = 1;
   
         if ((username = getlogin()) == NULL) {  
                 cvs_log(LP_ERRNO, "failed to get username");  
                 exit(1);  
         }  
   
         while ((ch = rcs_getopt(argc, argv, "f::j:l::M:N:qu::d::r::m:k:V")) != -1) {          while ((ch = rcs_getopt(argc, argv, "f::j:l::M:N:qu::d::r::m:k:Vw:")) != -1) {
                 switch (ch) {                  switch (ch) {
                 case 'd':                  case 'd':
                         if (rcs_optarg == NULL)                          if (rcs_optarg == NULL)
Line 152 
Line 148 
                 case 'V':                  case 'V':
                         printf("%s\n", rcs_version);                          printf("%s\n", rcs_version);
                         exit(0);                          exit(0);
                   case 'w':
                           username = rcs_optarg;
                           break;
                 default:                  default:
                         (usage)();                          (usage)();
                         exit(1);                          exit(1);
Line 167 
Line 166 
                 exit(1);                  exit(1);
         }          }
   
           if ((username == NULL) && (username = getlogin()) == NULL) {
                   cvs_log(LP_ERRNO, "failed to get username");
                   exit(1);
           }
   
   
         for (i = 0; i < argc; i++) {          for (i = 0; i < argc; i++) {
                 if (rcs_statfile(argv[i], fpath, sizeof(fpath)) < 0)                  if (rcs_statfile(argv[i], fpath, sizeof(fpath)) < 0)
                         continue;                          continue;
Line 296 
Line 301 
                  * Now add our new revision                   * Now add our new revision
                  */                   */
                 if (rcs_rev_add(file, (newrev == NULL ? RCS_HEAD_REV : newrev),                  if (rcs_rev_add(file, (newrev == NULL ? RCS_HEAD_REV : newrev),
                     rcs_msg, date) != 0) {                      rcs_msg, date, username) != 0) {
                         cvs_log(LP_ERR, "failed to add new revision");                          cvs_log(LP_ERR, "failed to add new revision");
                         exit(1);                          exit(1);
                 }                  }

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31