version 1.7, 2005/09/20 05:03:02 |
version 1.8, 2005/09/29 00:20:22 |
|
|
|
|
#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> |
|
|
"[-e users] [-k opt] file ...\n", __progname); |
"[-e users] [-k opt] file ...\n", __progname); |
} |
} |
|
|
|
|
/* |
/* |
* rcs_main() |
* rcs_main() |
* |
* |
|
|
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; |
|
|
* 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); |