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

Diff for /src/usr.bin/rcs/co.c between version 1.77 and 1.78

version 1.77, 2006/04/14 01:11:07 version 1.78, 2006/04/15 16:28:07
Line 36 
Line 36 
 int  int
 checkout_main(int argc, char **argv)  checkout_main(int argc, char **argv)
 {  {
         int i, ch, flags, kflag, status;          int i, ch, flags, kflag, status, warg;
         RCSNUM *frev, *rev;          RCSNUM *rev;
         RCSFILE *file;          RCSFILE *file;
         char fpath[MAXPATHLEN];          char fpath[MAXPATHLEN];
         char *author, *date, *rev_str, *username;          char *author, *date, *rev_str, *username, *state;
         const char *state;  
         time_t rcs_mtime = -1;          time_t rcs_mtime = -1;
   
         flags = status = 0;          warg = flags = status = 0;
         kflag = RCS_KWEXP_ERR;          kflag = RCS_KWEXP_ERR;
         rev = RCS_HEAD_REV;          rev = RCS_HEAD_REV;
         frev = NULL;  
         rev_str = NULL;          rev_str = NULL;
         state = NULL;          state = NULL;
         author = NULL;          author = NULL;
Line 123 
Line 121 
                         if (rcs_optarg == NULL) {                          if (rcs_optarg == NULL) {
                                 if ((author = getlogin()) == NULL)                                  if ((author = getlogin()) == NULL)
                                         fatal("getlogin failed");                                          fatal("getlogin failed");
                         } else                          } else {
                                 author = xstrdup(rcs_optarg);                                  author = xstrdup(rcs_optarg);
                                   warg = 1;
                           }
                         flags |= CO_AUTHOR;                          flags |= CO_AUTHOR;
                         break;                          break;
                 case 'x':                  case 'x':
Line 155 
Line 155 
         }          }
   
         for (i = 0; i < argc; i++) {          for (i = 0; i < argc; i++) {
                 frev = NULL;  
                 if (rcs_statfile(argv[i], fpath, sizeof(fpath)) < 0)                  if (rcs_statfile(argv[i], fpath, sizeof(fpath)) < 0)
                         continue;                          continue;
   
Line 208 
Line 207 
                         rcs_set_mtime(fpath, rcs_mtime);                          rcs_set_mtime(fpath, rcs_mtime);
         }          }
   
         if (rev != RCS_HEAD_REV && frev != NULL)          if (author != NULL && warg)
                 rcsnum_free(frev);                  xfree(author);
   
           if (date != NULL)
                   xfree(date);
   
           if (state != NULL)
                   xfree(state);
   
         return (status);          return (status);
 }  }

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