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

Diff for /src/usr.bin/rcs/rcsprog.c between version 1.7 and 1.8

version 1.7, 2005/09/20 05:03:02 version 1.8, 2005/09/29 00:20:22
Line 26 
Line 26 
   
 #include <sys/param.h>  #include <sys/param.h>
 #include <sys/wait.h>  #include <sys/wait.h>
   #include <sys/stat.h>
   
 #include <ctype.h>  #include <ctype.h>
 #include <err.h>  #include <err.h>
Line 94 
Line 95 
             "[-e users] [-k opt] file ...\n", __progname);              "[-e users] [-k opt] file ...\n", __progname);
 }  }
   
   
 /*  /*
  * rcs_main()   * rcs_main()
  *   *
Line 105 
Line 105 
 rcs_main(int argc, char **argv)  rcs_main(int argc, char **argv)
 {  {
         int i, ch, flags, kflag, lkmode;          int i, ch, flags, kflag, lkmode;
         char fpath[MAXPATHLEN];          char fpath[MAXPATHLEN], filev[MAXPATHLEN];
         char *oldfile, *alist, *comment, *elist, *unp, *sp;          char *oldfile, *alist, *comment, *elist, *unp, *sp;
         mode_t fmode;          mode_t fmode;
         RCSFILE *file;          RCSFILE *file;
           struct stat st;
   
         kflag = lkmode = -1;          kflag = lkmode = -1;
         fmode = 0;          fmode = 0;
Line 181 
Line 182 
                  * Our RCS API does not append the RCS_FILE_EXT extension                   * Our RCS API does not append the RCS_FILE_EXT extension
                  * automaticly in rcs_open(), so we add it here.                   * automaticly in rcs_open(), so we add it here.
                  */                   */
                 snprintf(fpath, sizeof(fpath), "%s%s", argv[i], RCS_FILE_EXT);                  snprintf(filev, sizeof(filev), "%s%s", argv[i], RCS_FILE_EXT);
                   if (stat(RCSDIR, &st) != -1) {
                           strlcpy(fpath, RCSDIR, sizeof(fpath));
                           strlcat(fpath, "/", sizeof(fpath));
                           strlcat(fpath, filev, sizeof(fpath));
                   } else {
                           strlcpy(fpath, filev, sizeof(filev));
                   }
   
                   if (stat(fpath, &st) != -1) {
                           errno = EEXIST;
                           cvs_log(LP_ERRNO, "%s", fpath);
                           continue;
                   }
   
                 printf("RCS file: %s\n", fpath);                  printf("RCS file: %s\n", fpath);
                 file = rcs_open(fpath, flags, fmode);                  file = rcs_open(fpath, flags, fmode);

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8