home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-02-23 | 109.2 KB | 3,811 lines |
- diff -cb orig/add.c src/add.c
- *** orig/add.c Sun Feb 23 15:02:20 1992
- --- src/add.c Sun Feb 23 17:06:38 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: add.c,v 1.10 89/11/19 23:40:28 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: add.c,v 1.10 89/11/19 23:40:28 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 28,34 ****
- * cause the file to be resurrected.
- */
-
- - #include <sys/param.h>
- #include "cvs.h"
-
- add(argc, argv)
- --- 28,33 ----
- ***************
- *** 68,74 ****
- err += add_directory(User);
- continue;
- }
- ! (void) sprintf(Rcs, "%s/%s%s", Repository, User, RCSEXT);
- Version_TS(Rcs, Tag, User);
- if (VN_User[0] == '\0') {
- /*
- --- 67,73 ----
- err += add_directory(User);
- continue;
- }
- ! (void) sprintf(Rcs, "%s%c%s%s", Repository, DIRSEP, User, RCSEXT);
- Version_TS(Rcs, Tag, User);
- if (VN_User[0] == '\0') {
- /*
- ***************
- *** 171,181 ****
- char cwd[MAXPATHLEN], rcsdir[MAXPATHLEN];
- char message[MAXPATHLEN+100];
-
- ! if (index(dir, '/') != NULL) {
- warn(0, "directory %s not added; must be a direct sub-directory", dir);
- return (1);
- }
- ! if (strcmp(dir, CVSADM) == 0) {
- warn(0, "cannot add a '%s' directory", CVSADM);
- return (1);
- }
- --- 170,180 ----
- char cwd[MAXPATHLEN], rcsdir[MAXPATHLEN];
- char message[MAXPATHLEN+100];
-
- ! if (index_sep(dir) != NULL) {
- warn(0, "directory %s not added; must be a direct sub-directory", dir);
- return (1);
- }
- ! if (stricmp(dir, CVSADM) == 0) {
- warn(0, "cannot add a '%s' directory", CVSADM);
- return (1);
- }
- ***************
- *** 188,197 ****
- return (1);
- }
- if (isfile(CVSADM)) {
- ! warn(0, "%s/%s already exists", dir, CVSADM);
- goto out;
- }
- ! (void) sprintf(rcsdir, "%s/%s", Repository, dir);
- if (isfile(rcsdir) && !isdir(rcsdir)) {
- warn(0, "%s is not a directory; %s not added", rcsdir, dir);
- goto out;
- --- 187,196 ----
- return (1);
- }
- if (isfile(CVSADM)) {
- ! warn(0, "%s%c%s already exists", dir, DIRSEP, CVSADM);
- goto out;
- }
- ! (void) sprintf(rcsdir, "%s%c%s", Repository, DIRSEP, dir);
- if (isfile(rcsdir) && !isdir(rcsdir)) {
- warn(0, "%s is not a directory; %s not added", rcsdir, dir);
- goto out;
- ***************
- *** 202,208 ****
- FILE *fptty;
- char line[MAXLINELEN];
-
- ! fptty = open_file("/dev/tty", "r");
- printf("Add directory %s to the repository (y/n) [n] ? ", rcsdir);
- (void) fflush(stdout);
- if (fgets(line, sizeof(line), fptty) == NULL ||
- --- 201,207 ----
- FILE *fptty;
- char line[MAXLINELEN];
-
- ! fptty = open_file(CONSOLE, "r");
- printf("Add directory %s to the repository (y/n) [n] ? ", rcsdir);
- (void) fflush(stdout);
- if (fgets(line, sizeof(line), fptty) == NULL ||
- diff -cb orig/build_entry.c src/build_entry.c
- *** orig/build_entry.c Sun Feb 23 15:02:20 1992
- --- src/build_entry.c Sun Feb 23 18:08:22 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: build_entry.c,v 1.9 89/11/19 23:19:45 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: build_entry.c,v 1.9 89/11/19 23:19:45 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 16,22 ****
- * Returns non-zero on error.
- */
-
- - #include <sys/param.h>
- #include "cvs.h"
-
- Build_Entry(message)
- --- 16,21 ----
- ***************
- *** 31,47 ****
- * This is, perhaps, an awkward place to check for this, but
- * other places are equally awkward.
- */
- ! (void) sprintf(fname, "%s/%s/%s%s", Repository, CVSATTIC, User, RCSEXT);
- if (isreadable(fname)) {
- ! warn(0, "there is an old file %s already in %s/%s", User,
- ! Repository, CVSATTIC);
- return (1);
- }
- /*
- * The options for the "add" command are store in the file CVS.adm/User,p
- */
- ! (void) sprintf(fname, "%s/%s%s", CVSADM, User, CVSEXT_OPT);
- ! fp = open_file(fname, "w+");
- if (fprintf(fp, "%s\n", Options) == EOF)
- error(1, "cannot write %s", fname);
- (void) fclose(fp);
- --- 30,49 ----
- * This is, perhaps, an awkward place to check for this, but
- * other places are equally awkward.
- */
- ! (void) sprintf(fname, "%s%c%s%c%s%s",
- ! Repository, DIRSEP, CVSATTIC, DIRSEP, User, RCSEXT);
- if (isreadable(fname)) {
- ! warn(0, "there is an old file %s already in %s%c%s", User,
- ! Repository, DIRSEP, CVSATTIC);
- return (1);
- }
- /*
- * The options for the "add" command are store in the file CVS.adm/User,p
- */
- ! (void) mkdir(CVSEXT_OPT, 0777);
- ! (void) sprintf(fname, "%s%c%s", CVSEXT_OPT, DIRSEP, User);
- ! if ((fp = open_file(fname, "w+")) == NULL)
- ! error(1, "cannot write %s", fname);
- if (fprintf(fp, "%s\n", Options) == EOF)
- error(1, "cannot write %s", fname);
- (void) fclose(fp);
- ***************
- *** 51,63 ****
- * user specified the -m option to add, and it is not necessary to
- * query him from the terminal.
- */
- ! (void) sprintf(fname, "%s/%s%s", CVSADM, User, CVSEXT_LOG);
- ! fp = open_file(fname, "w+");
- if (message[0] == '\0') {
- printf("RCS file: %s\n", Rcs);
- printf("enter description, terminated with ^D or '.':\n");
- printf("NOTE: This is NOT the log message!\n");
- ! fptty = open_file("/dev/tty", "r");
- for (;;) {
- printf(">> ");
- (void) fflush(stdout);
- --- 53,67 ----
- * user specified the -m option to add, and it is not necessary to
- * query him from the terminal.
- */
- ! (void) mkdir(CVSEXT_LOG, 0777);
- ! (void) sprintf(fname, "%s%c%s", CVSEXT_LOG, DIRSEP, User);
- ! if ((fp = open_file(fname, "w+")) == NULL)
- ! error(1, "cannot write %s", fname);
- if (message[0] == '\0') {
- printf("RCS file: %s\n", Rcs);
- printf("enter description, terminated with ^D or '.':\n");
- printf("NOTE: This is NOT the log message!\n");
- ! fptty = open_file(CONSOLE, "r");
- for (;;) {
- printf(">> ");
- (void) fflush(stdout);
- diff -cb orig/checkin.c src/checkin.c
- *** orig/checkin.c Sun Feb 23 15:02:22 1992
- --- src/checkin.c Sun Feb 23 19:10:54 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: checkin.c,v 1.10 89/11/19 23:19:46 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: checkin.c,v 1.10 89/11/19 23:19:46 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 19,25 ****
- * Returns non-zero on error.
- */
-
- - #include <sys/param.h>
- #include <ctype.h>
- #include "cvs.h"
-
- --- 19,24 ----
- ***************
- *** 44,51 ****
- printf("Checking in %s;\n", User);
- if (!use_editor)
- printf("Log: %s\n", message);
- ! (void) sprintf(Rcs, "%s/%s%s", Repository, User, RCSEXT);
- ! (void) sprintf(fname, "%s/%s%s", CVSADM, CVSPREFIX, User);
- /*
- * Move the user file to a backup file, so as to preserve its
- * modification times, then place a copy back in the original
- --- 43,51 ----
- printf("Checking in %s;\n", User);
- if (!use_editor)
- printf("Log: %s\n", message);
- ! (void) fflush(stdout);
- ! (void) sprintf(Rcs, "%s%c%s%s", Repository, DIRSEP, User, RCSEXT);
- ! (void) sprintf(fname, "%s%c%s%s", CVSADM, DIRSEP, CVSPREFIX, User);
- /*
- * Move the user file to a backup file, so as to preserve its
- * modification times, then place a copy back in the original
- ***************
- *** 53,59 ****
- */
- rename_file(User, fname);
- copy_file(fname, User);
- ! (void) sprintf(prog, "%s/%s -f %s %s", Rcsbin, RCS_CI, revision, Rcs);
- if ((fp = popen(prog, "w")) == NULL) {
- err++;
- } else {
- --- 53,59 ----
- */
- rename_file(User, fname);
- copy_file(fname, User);
- ! (void) sprintf(prog, "%s -f %s %s", RCS_CI, revision, Rcs);
- if ((fp = popen(prog, "w")) == NULL) {
- err++;
- } else {
- ***************
- *** 69,75 ****
- * to leave the newly checkout file as the user file and remove
- * the old original user file.
- */
- ! (void) sprintf(prog, "%s/%s -q %s %s", Rcsbin, RCS_CO, revision, Rcs);
- (void) system(prog);
- xchmod(User, 1); /* make it writable */
- if (xcmp(User, fname) == 0)
- --- 69,75 ----
- * to leave the newly checkout file as the user file and remove
- * the old original user file.
- */
- ! (void) sprintf(prog, "%s -q %s %s", RCS_CO, revision, Rcs);
- (void) system(prog);
- xchmod(User, 1); /* make it writable */
- if (xcmp(User, fname) == 0)
- ***************
- *** 94,100 ****
- */
- rename_file(fname, User);
- warn(0, "could not check in %s", User);
- ! (void) sprintf(prog, "%s/%s -u %s", Rcsbin, RCS, Rcs);
- if (system(prog) != 0)
- warn(0, "could not UNlock %s", Rcs);
- restore_branch();
- --- 94,100 ----
- */
- rename_file(fname, User);
- warn(0, "could not check in %s", User);
- ! (void) sprintf(prog, "%s -u %s", RCS, Rcs);
- if (system(prog) != 0)
- warn(0, "could not UNlock %s", Rcs);
- restore_branch();
- ***************
- *** 106,112 ****
- * wrong branch, so to be sure, we do an extra unlock here
- * before returning.
- */
- ! (void) sprintf(prog, "%s/%s -q -u %s 2>%s", Rcsbin, RCS, Rcs, DEVNULL);
- (void) system(prog);
- }
- return (0);
- --- 106,112 ----
- * wrong branch, so to be sure, we do an extra unlock here
- * before returning.
- */
- ! (void) sprintf(prog, "%s -q -u %s 2>%s", RCS, Rcs, DEVNULL);
- (void) system(prog);
- }
- return (0);
- ***************
- *** 137,148 ****
- user--;
- *cp++ = '\0';
- if (strcmp(User, user) == 0) {
- ! (void) sprintf(prog, "%s/%s -q -b%s %s", Rcsbin, RCS,
- ! cp, Rcs);
- if (system(prog) != 0)
- warn(0, "cannot restore default branch %s for %s",
- cp, Rcs);
- ! return;
- }
- }
- }
- --- 137,147 ----
- user--;
- *cp++ = '\0';
- if (strcmp(User, user) == 0) {
- ! (void) sprintf(prog, "%s -q -b%s %s", RCS, cp, Rcs);
- if (system(prog) != 0)
- warn(0, "cannot restore default branch %s for %s",
- cp, Rcs);
- ! return 0;
- }
- }
- }
- diff -cb orig/checkout.c src/checkout.c
- *** orig/checkout.c Sun Feb 23 15:02:22 1992
- --- src/checkout.c Sun Jan 19 22:05:02 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: checkout.c,v 1.19 89/11/19 23:40:30 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: checkout.c,v 1.19 89/11/19 23:40:30 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 56,63 ****
- * the repository is moved, e.g.)
- */
-
- - #include <sys/param.h>
- - #include <ndbm.h>
- #include "cvs.h"
-
- extern int update_prune_dirs;
- --- 56,61 ----
- ***************
- *** 136,142 ****
- char *cp;
-
- (void) strcpy(path, dir);
- ! for (cp = path; (slash = index(cp, '/')) != NULL; cp = slash+1) {
- *slash = '\0';
- (void) mkdir(cp, 0777);
- if (chdir(cp) < 0) {
- --- 134,140 ----
- char *cp;
-
- (void) strcpy(path, dir);
- ! for (cp = path; (slash = index_sep(cp)) != NULL; cp = slash+1) {
- *slash = '\0';
- (void) mkdir(cp, 0777);
- if (chdir(cp) < 0) {
- ***************
- *** 144,155 ****
- return (1);
- }
- if (!isfile(CVSADM)) {
- ! (void) sprintf(Repository, "%s/%s", CVSroot, path);
- Create_Admin(Repository, DFLT_RECORD);
- fp = open_file(CVSADM_ENTSTAT, "w+");
- (void) fclose(fp);
- }
- ! *slash = '/';
- }
- (void) mkdir(cp, 0777);
- if (chdir(cp) < 0) {
- --- 142,153 ----
- return (1);
- }
- if (!isfile(CVSADM)) {
- ! (void) sprintf(Repository, "%s%c%s", CVSroot, DIRSEP, path);
- Create_Admin(Repository, DFLT_RECORD);
- fp = open_file(CVSADM_ENTSTAT, "w+");
- (void) fclose(fp);
- }
- ! *slash = DIRSEP;
- }
- (void) mkdir(cp, 0777);
- if (chdir(cp) < 0) {
- diff -cb orig/collect_sets.c src/collect_sets.c
- *** orig/collect_sets.c Sun Feb 23 15:02:22 1992
- --- src/collect_sets.c Sun Jan 19 22:20:26 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: collect_sets.c,v 1.15.1.1 91/01/29 07:16:13 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: collect_sets.c,v 1.15.1.1 91/01/29 07:16:13 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 27,33 ****
- * Returns non-zero on error.
- */
-
- - #include <sys/param.h>
- #include "cvs.h"
-
- extern char update_dir[];
- --- 27,32 ----
- ***************
- *** 48,60 ****
- for (i = 0; i < argc; i++) {
- (void) strcpy(User, argv[i]);
- if (update_dir[0] != '\0')
- ! (void) sprintf(update_user, "%s/%s", update_dir, User);
- else
- (void) strcpy(update_user, User);
- if (force_tag_match && (Tag[0] != '\0' || Date[0] != '\0'))
- Locate_RCS();
- else
- ! (void) sprintf(Rcs, "%s/%s%s", Repository, User, RCSEXT);
- if (isdir(User)) { /* just a directory -- add to Dlist */
- (void) strcat(Dlist, " ");
- (void) strcat(Dlist, User);
- --- 47,59 ----
- for (i = 0; i < argc; i++) {
- (void) strcpy(User, argv[i]);
- if (update_dir[0] != '\0')
- ! (void) sprintf(update_user, "%s%c%s", update_dir, DIRSEP, User);
- else
- (void) strcpy(update_user, User);
- if (force_tag_match && (Tag[0] != '\0' || Date[0] != '\0'))
- Locate_RCS();
- else
- ! (void) sprintf(Rcs, "%s%c%s%s", Repository, DIRSEP, User, RCSEXT);
- if (isdir(User)) { /* just a directory -- add to Dlist */
- (void) strcat(Dlist, " ");
- (void) strcat(Dlist, User);
- diff -cb orig/commit.c src/commit.c
- *** orig/commit.c Sun Feb 23 15:02:24 1992
- --- src/commit.c Sun Feb 23 19:10:24 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: commit.c,v 1.28.1.2 91/01/29 07:16:59 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: commit.c,v 1.28.1.2 91/01/29 07:16:59 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 31,39 ****
- * like to commit.
- */
-
- - #include <sys/param.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <ctype.h>
- #include "cvs.h"
-
- --- 31,39 ----
- * like to commit.
- */
-
- #include <sys/types.h>
- #include <sys/stat.h>
- + #include <fcntl.h>
- #include <ctype.h>
- #include "cvs.h"
-
- ***************
- *** 55,62 ****
- --- 55,64 ----
- /*
- * For log purposes, do not allow "root" to commit files
- */
- + #ifndef OS2
- if (geteuid() == 0)
- error(0, "cannot commit files as 'root'");
- + #endif
- optind = 1;
- while ((c = getopt(argc, argv, "fnam:r:")) != -1) {
- switch (c) {
- ***************
- *** 106,112 ****
- register int i;
- FILE *fptty;
-
- ! fptty = open_file("/dev/tty", "r");
- printf("WARNING:\n");
- printf("\tCommitting with a specific revision number\n");
- printf("\tbypasses all consistency checks. Are you abosulutely\n");
- --- 108,114 ----
- register int i;
- FILE *fptty;
-
- ! fptty = open_file(CONSOLE, "r");
- printf("WARNING:\n");
- printf("\tCommitting with a specific revision number\n");
- printf("\tbypasses all consistency checks. Are you abosulutely\n");
- ***************
- *** 217,223 ****
- }
- }
- if (first == 0) {
- ! FILE *fptty = open_file("/dev/tty", "r");
- printf("\tAre you sure you want to continue (y/n) [n] ? ");
- (void) fflush(stdout);
- if (fgets(line, sizeof(line), fptty) == NULL ||
- --- 219,225 ----
- }
- }
- if (first == 0) {
- ! FILE *fptty = open_file(CONSOLE, "r");
- printf("\tAre you sure you want to continue (y/n) [n] ? ");
- (void) fflush(stdout);
- if (fgets(line, sizeof(line), fptty) == NULL ||
- ***************
- *** 235,241 ****
- (void) strcpy(line, Mlist);
- for (cp = strtok(line, " \t"); cp; cp = strtok((char *)NULL, " \t")) {
- (void) strcpy(User, cp);
- ! (void) sprintf(Rcs, "%s/%s%s", Repository, User, RCSEXT);
- if (lock_RCS(rev) != 0)
- err++;
- }
- --- 237,243 ----
- (void) strcpy(line, Mlist);
- for (cp = strtok(line, " \t"); cp; cp = strtok((char *)NULL, " \t")) {
- (void) strcpy(User, cp);
- ! (void) sprintf(Rcs, "%s%c%s%s", Repository, DIRSEP, User, RCSEXT);
- if (lock_RCS(rev) != 0)
- err++;
- }
- ***************
- *** 245,251 ****
- (void) strcpy(line, Rlist);
- for (cp = strtok(line, " \t"); cp; cp = strtok((char *)NULL, " \t")) {
- (void) strcpy(User, cp);
- ! (void) sprintf(Rcs, "%s/%s%s", Repository, User, RCSEXT);
- if (lock_RCS(rev) != 0)
- err++;
- }
- --- 247,253 ----
- (void) strcpy(line, Rlist);
- for (cp = strtok(line, " \t"); cp; cp = strtok((char *)NULL, " \t")) {
- (void) strcpy(User, cp);
- ! (void) sprintf(Rcs, "%s%c%s%s", Repository, DIRSEP, User, RCSEXT);
- if (lock_RCS(rev) != 0)
- err++;
- }
- ***************
- *** 255,264 ****
- (void) strcpy(line, Alist);
- for (cp = strtok(line, " \t"); cp; cp = strtok((char *)NULL, " \t")) {
- (void) strcpy(User, cp);
- ! (void) sprintf(Rcs, "%s/%s%s", Repository, User, RCSEXT);
- ! (void) sprintf(prog, "%s/%s -i -t%s/%s%s", Rcsbin, RCS, CVSADM,
- ! User, CVSEXT_LOG);
- ! (void) sprintf(fname, "%s/%s%s", CVSADM, User, CVSEXT_OPT);
- fp = open_file(fname, "r");
- while (fgets(fname, sizeof(fname), fp) != NULL) {
- if ((cp = rindex(fname, '\n')) != NULL)
- --- 257,265 ----
- (void) strcpy(line, Alist);
- for (cp = strtok(line, " \t"); cp; cp = strtok((char *)NULL, " \t")) {
- (void) strcpy(User, cp);
- ! (void) sprintf(Rcs, "%s%c%s%s", Repository, DIRSEP, User, RCSEXT);
- ! (void) sprintf(prog, "%s -i -t%s%c%s", RCS, CVSEXT_LOG, DIRSEP, User);
- ! (void) sprintf(fname, "%s%c%s", CVSEXT_OPT, DIRSEP, User);
- fp = open_file(fname, "r");
- while (fgets(fname, sizeof(fname), fp) != NULL) {
- if ((cp = rindex(fname, '\n')) != NULL)
- ***************
- *** 287,294 ****
- for (cp = strtok(Llist, " \t"); cp; cp = strtok((char *)NULL, " \t")) {
- didllist = 1;
- (void) strcpy(User, cp);
- ! (void) sprintf(Rcs, "%s/%s%s", Repository, User, RCSEXT);
- ! (void) sprintf(prog, "%s/%s -q -u %s", Rcsbin, RCS, Rcs);
- if (system(prog) != 0)
- warn(0, "could not UNlock %s", Rcs);
- }
- --- 288,295 ----
- for (cp = strtok(Llist, " \t"); cp; cp = strtok((char *)NULL, " \t")) {
- didllist = 1;
- (void) strcpy(User, cp);
- ! (void) sprintf(Rcs, "%s%c%s%s", Repository, DIRSEP, User, RCSEXT);
- ! (void) sprintf(prog, "%s -q -u %s", RCS, Rcs);
- if (system(prog) != 0)
- warn(0, "could not UNlock %s", Rcs);
- }
- ***************
- *** 298,306 ****
- continue;
- *branch++ = '\0';
- (void) strcpy(User, cp);
- ! (void) sprintf(Rcs, "%s/%s%s", Repository, User, RCSEXT);
- ! (void) sprintf(prog, "%s/%s -q -b%s %s", Rcsbin, RCS,
- ! branch, Rcs);
- if (system(prog) != 0)
- warn(0, "could not restore branch %s to %s", branch, Rcs);
- }
- --- 299,306 ----
- continue;
- *branch++ = '\0';
- (void) strcpy(User, cp);
- ! (void) sprintf(Rcs, "%s%c%s%s", Repository, DIRSEP, User, RCSEXT);
- ! (void) sprintf(prog, "%s -q -b%s %s", RCS, branch, Rcs);
- if (system(prog) != 0)
- warn(0, "could not restore branch %s to %s", branch, Rcs);
- }
- ***************
- *** 307,313 ****
- }
- for (cp = strtok(Alist, " \t"); cp; cp = strtok((char *)NULL, " \t")) {
- (void) strcpy(User, cp);
- ! (void) sprintf(Rcs, "%s/%s%s", Repository, User, RCSEXT);
- (void) unlink(Rcs);
- }
- Lock_Cleanup(0);
- --- 307,313 ----
- }
- for (cp = strtok(Alist, " \t"); cp; cp = strtok((char *)NULL, " \t")) {
- (void) strcpy(User, cp);
- ! (void) sprintf(Rcs, "%s%c%s%s", Repository, DIRSEP, User, RCSEXT);
- (void) unlink(Rcs);
- }
- Lock_Cleanup(0);
- ***************
- *** 337,346 ****
- (void) strcpy(User, cp);
- if (Checkin(revision, message) != 0)
- err++;
- ! (void) sprintf(fname, "%s/%s%s", CVSADM, User, CVSEXT_OPT);
- (void) unlink(fname);
- ! (void) sprintf(fname, "%s/%s%s", CVSADM, User, CVSEXT_LOG);
- (void) unlink(fname);
- }
- }
- /*
- --- 337,348 ----
- (void) strcpy(User, cp);
- if (Checkin(revision, message) != 0)
- err++;
- ! (void) sprintf(fname, "%s%c%s", CVSEXT_OPT, DIRSEP, User);
- (void) unlink(fname);
- ! (void) rmdir(CVSEXT_OPT);
- ! (void) sprintf(fname, "%s%c%s", CVSEXT_LOG, DIRSEP, User);
- (void) unlink(fname);
- + (void) rmdir(CVSEXT_LOG);
- }
- }
- /*
- ***************
- *** 368,381 ****
- int omask;
-
- (void) strcpy(User, cp);
- ! (void) sprintf(Rcs, "%s/%s%s", Repository, User, RCSEXT);
- ! (void) sprintf(fname, "%s/%s", Repository, CVSATTIC);
- omask = umask(2);
- (void) mkdir(fname, 0777);
- (void) umask(omask);
- ! (void) sprintf(fname, "%s/%s/%s%s", Repository, CVSATTIC,
- ! User, RCSEXT);
- ! (void) sprintf(prog, "%s/%s -u -q %s", Rcsbin, RCS, Rcs);
- if ((system(prog) == 0 && rename(Rcs, fname) != -1) ||
- (!isreadable(Rcs) && isreadable(fname)))
- Scratch_Entry(User);
- --- 370,383 ----
- int omask;
-
- (void) strcpy(User, cp);
- ! (void) sprintf(Rcs, "%s%c%s%s", Repository, DIRSEP, User, RCSEXT);
- ! (void) sprintf(fname, "%s%c%s", Repository, DIRSEP, CVSATTIC);
- omask = umask(2);
- (void) mkdir(fname, 0777);
- (void) umask(omask);
- ! (void) sprintf(fname, "%s%c%s%c%s%s", Repository, DIRSEP, CVSATTIC,
- ! DIRSEP, User, RCSEXT);
- ! (void) sprintf(prog, "%s -u -q %s", RCS, Rcs);
- if ((system(prog) == 0 && rename(Rcs, fname) != -1) ||
- (!isreadable(Rcs) && isreadable(fname)))
- Scratch_Entry(User);
- ***************
- *** 411,427 ****
- if (numdots(rev) < 2) {
- branch_number(Rcs, branch);
- if (branch[0] != '\0') {
- ! (void) sprintf(prog, "%s/%s -q -b %s", Rcsbin, RCS, Rcs);
- if (system(prog) != 0) {
- warn(0, "cannot change branch to default for %s", Rcs);
- return (1);
- }
- }
- ! (void) sprintf(prog, "%s/%s -q -l %s", Rcsbin, RCS, Rcs);
- err = system(prog);
- } else {
- ! (void) sprintf(prog, "%s/%s -q -l%s %s 2>%s",
- ! Rcsbin, RCS, rev, Rcs, DEVNULL);
- (void) system(prog);
- }
- if (err == 0) {
- --- 413,428 ----
- if (numdots(rev) < 2) {
- branch_number(Rcs, branch);
- if (branch[0] != '\0') {
- ! (void) sprintf(prog, "%s -q -b %s", RCS, Rcs);
- if (system(prog) != 0) {
- warn(0, "cannot change branch to default for %s", Rcs);
- return (1);
- }
- }
- ! (void) sprintf(prog, "%s -q -l %s", RCS, Rcs);
- err = system(prog);
- } else {
- ! (void) sprintf(prog, "%s -q -l%s %s 2>%s", RCS, rev, Rcs, DEVNULL);
- (void) system(prog);
- }
- if (err == 0) {
- ***************
- *** 436,442 ****
- return (0);
- }
- if (branch[0] != '\0') {
- ! (void) sprintf(prog, "%s/%s -q -b%s %s", Rcsbin, RCS, branch, Rcs);
- if (system(prog) != 0)
- warn(0, "cannot restore branch to %s for %s", branch, Rcs);
- }
- --- 437,443 ----
- return (0);
- }
- if (branch[0] != '\0') {
- ! (void) sprintf(prog, "%s -q -b%s %s", RCS, branch, Rcs);
- if (system(prog) != 0)
- warn(0, "cannot restore branch to %s for %s", branch, Rcs);
- }
- ***************
- *** 462,485 ****
- fp = open_file(rcs, "r");
- if (fgets(line, sizeof(line), fp) == NULL) {
- (void) fclose(fp);
- ! return;
- }
- if (fgets(line, sizeof(line), fp) == NULL) {
- (void) fclose(fp);
- ! return;
- }
- (void) fclose(fp);
- if (strncmp(line, RCSBRANCH, sizeof(RCSBRANCH) - 1) != 0 ||
- !isspace(line[sizeof(RCSBRANCH) - 1]) ||
- (cp = rindex(line, ';')) == NULL)
- ! return;
- *cp = '\0'; /* strip the ';' */
- if ((cp = rindex(line, ' ')) == NULL &&
- (cp = rindex(line, '\t')) == NULL)
- ! return;
- cp++;
- ! if (*cp == NULL)
- ! return;
- (void) strcpy(branch, cp);
- }
-
- --- 463,486 ----
- fp = open_file(rcs, "r");
- if (fgets(line, sizeof(line), fp) == NULL) {
- (void) fclose(fp);
- ! return 0;
- }
- if (fgets(line, sizeof(line), fp) == NULL) {
- (void) fclose(fp);
- ! return 0;
- }
- (void) fclose(fp);
- if (strncmp(line, RCSBRANCH, sizeof(RCSBRANCH) - 1) != 0 ||
- !isspace(line[sizeof(RCSBRANCH) - 1]) ||
- (cp = rindex(line, ';')) == NULL)
- ! return 0;
- *cp = '\0'; /* strip the ';' */
- if ((cp = rindex(line, ' ')) == NULL &&
- (cp = rindex(line, '\t')) == NULL)
- ! return 0;
- cp++;
- ! if (*cp == 0)
- ! return 0;
- (void) strcpy(branch, cp);
- }
-
- ***************
- *** 594,608 ****
-
- if (CVSroot == NULL) {
- warn(0, "CVSROOT variable not set; no log message will be sent");
- ! return;
- }
- ! (void) sprintf(logfile, "%s/%s", CVSroot, CVSROOTADM_LOGINFO);
- if ((fp_info = fopen(logfile, "r")) == NULL) {
- warn(0, "warning: cannot open %s", logfile);
- ! return;
- }
- if (CVSroot != NULL)
- ! (void) sprintf(path, "%s/", CVSroot);
- else
- (void) strcpy(path, REPOS_STRIP);
- if (strncmp(repository, path, strlen(path)) == 0)
- --- 595,609 ----
-
- if (CVSroot == NULL) {
- warn(0, "CVSROOT variable not set; no log message will be sent");
- ! return 0;
- }
- ! (void) sprintf(logfile, "%s%c%s", CVSroot, DIRSEP, CVSROOTADM_LOGINFO);
- if ((fp_info = fopen(logfile, "r")) == NULL) {
- warn(0, "warning: cannot open %s", logfile);
- ! return 0;
- }
- if (CVSroot != NULL)
- ! (void) sprintf(path, "%s%c", CVSroot, DIRSEP);
- else
- (void) strcpy(path, REPOS_STRIP);
- if (strncmp(repository, path, strlen(path)) == 0)
- ***************
- *** 673,679 ****
- */
- #ifndef MAXHOSTNAMELEN
- #define MAXHOSTNAMELEN 64
- ! #endif !MAXHOSTNAMELEN
-
- /*
- * Writes some stuff to the logfile "filter" and returns the status of the
- --- 674,680 ----
- */
- #ifndef MAXHOSTNAMELEN
- #define MAXHOSTNAMELEN 64
- ! #endif
-
- /*
- * Writes some stuff to the logfile "filter" and returns the status of the
- diff -cb orig/create_admin.c src/create_admin.c
- *** orig/create_admin.c Sun Feb 23 15:02:24 1992
- --- src/create_admin.c Sun Jan 19 22:28:30 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: create_admin.c,v 1.7 89/11/19 23:19:55 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: create_admin.c,v 1.7 89/11/19 23:19:55 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 15,21 ****
- * argument.
- */
-
- - #include <sys/param.h>
- #include "cvs.h"
-
- Create_Admin(repository, initrecord)
- --- 15,20 ----
- ***************
- *** 37,43 ****
- if (CVSroot != NULL) {
- char path[MAXPATHLEN];
-
- ! (void) sprintf(path, "%s/", CVSroot);
- if (strncmp(repository, path, strlen(path)) == 0)
- cp = repository + strlen(path);
- }
- --- 36,42 ----
- if (CVSroot != NULL) {
- char path[MAXPATHLEN];
-
- ! (void) sprintf(path, "%s%c", CVSroot, DIRSEP);
- if (strncmp(repository, path, strlen(path)) == 0)
- cp = repository + strlen(path);
- }
- diff -cb orig/cvs.h src/cvs.h
- *** orig/cvs.h Sun Feb 23 15:02:26 1992
- --- src/cvs.h Sun Feb 23 19:11:28 1992
- ***************
- *** 1,8 ****
- /* $Id: cvs.h,v 1.24.1.1 91/01/18 12:13:48 berliner Exp $ */
-
- - #include <strings.h>
- #include <string.h>
- #include <stdio.h>
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,30 ----
- /* $Id: cvs.h,v 1.24.1.1 91/01/18 12:13:48 berliner Exp $ */
-
- #include <string.h>
- #include <stdio.h>
- + #include <time.h>
- + #include <direct.h>
- + #include "ndbm.h"
- + #include "regex.h"
- +
- + #ifdef OS2
- + /* OS/2 can generally use / too, but not in some places when commands
- + * are passed to CMD.EXE for execution (i.e. I/O redirection). */
- + #define DIRSEP '\\'
- + #define DIRSEPSTR "\\"
- + #define ISDIRSEP(c) ((c) == DIRSEP || (c) == '/')
- + extern char *index_sep(char *);
- + extern char *rindex_sep(char *);
- + #define system(c) (flushall(),system(c))
- + #else
- + #define DIRSEP '/'
- + #define DIRSEPSTR "/"
- + #define ISDIRSEP(c) ((c) == DIRSEP)
- + #define index_sep(p) index(p, DIRSEP)
- + #define rindex_sep(p) rindex(p, DIRSEP)
- + #define stricmp strcmp
- + #define strnicmp strncmp
- + #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 15,27 ****
- * the names a simple task.
- */
- #define CVSADM "CVS.adm"
- #define CVSADM_ENT "CVS.adm/Entries"
- ! #define CVSADM_ENTBAK "CVS.adm/Entries.Backup"
- ! #define CVSADM_ENTSTAT "CVS.adm/Entries.Static"
- #define CVSADM_FILE "CVS.adm/Files"
- #define CVSADM_MOD "CVS.adm/Mod"
- ! #define CVSADM_REP "CVS.adm/Repository"
- ! #define CVSADM_CIPROG "CVS.adm/Checkin.prog"
-
- /*
- * Definitions for the CVSROOT Administrative directory and
- --- 37,52 ----
- * the names a simple task.
- */
- #define CVSADM "CVS.adm"
- + #define CVSEXT_OPT "CVS.opt"
- + #define CVSEXT_LOG "CVS.log"
- +
- #define CVSADM_ENT "CVS.adm/Entries"
- ! #define CVSADM_ENTBAK "CVS.adm/Entries.Bak"
- ! #define CVSADM_ENTSTAT "CVS.adm/Entries.Sta"
- #define CVSADM_FILE "CVS.adm/Files"
- #define CVSADM_MOD "CVS.adm/Mod"
- ! #define CVSADM_REP "CVS.adm/Reposit.ory"
- ! #define CVSADM_CIPROG "CVS.adm/Checkin.prg"
-
- /*
- * Definitions for the CVSROOT Administrative directory and
- ***************
- *** 36,64 ****
-
- /* support for the CVSROOTADM files */
- #define CVSMODULE_FILE "modules" /* last component of CVSROOTADM_MODULES */
- ! #define CVSMODULE_TMP ".#modules.XXXXXX"
- #define CVSMODULE_OPTS "ai:o:t:"
- #define CVSLOGINFO_FILE "loginfo" /* last component of CVSROOTADM_LOGINFO */
- ! #define CVSLOGINFO_TMP ".#loginfo.XXXXXX"
-
- /* Other CVS file names */
- #define CVSATTIC "Attic"
- ! #define CVSLCK "#cvs.lock"
- ! #define CVSTFL "#cvs.tfl"
- ! #define CVSRFL "#cvs.rfl"
- ! #define CVSWFL "#cvs.wfl"
- ! #define CVSEXT_OPT ",p"
- ! #define CVSEXT_LOG ",t"
- ! #define CVSPREFIX ",,"
- ! #define CVSTEMP "/tmp/cvslog.XXXXXX"
-
- /* miscellaneous CVS defines */
- #define CVSEDITPREFIX "CVS: "
- #define CVSLCKAGE 600 /* 10-min old lock files cleaned up */
- #define CVSLCKSLEEP 15 /* wait 15 seconds before retrying */
- ! #define DFLT_RECORD "/dev/null"
- ! #define BAKPREFIX ".#" /* when rcsmerge'ing */
- ! #define DEVNULL "/dev/null"
-
- #define FALSE 0
- #define TRUE 1
- --- 61,89 ----
-
- /* support for the CVSROOTADM files */
- #define CVSMODULE_FILE "modules" /* last component of CVSROOTADM_MODULES */
- ! #define CVSMODULE_TMP "#mXXXXXX"
- #define CVSMODULE_OPTS "ai:o:t:"
- #define CVSLOGINFO_FILE "loginfo" /* last component of CVSROOTADM_LOGINFO */
- ! #define CVSLOGINFO_TMP "#lXXXXXX"
-
- /* Other CVS file names */
- #define CVSATTIC "Attic"
- ! #define CVSLCK "#cvs_lck"
- ! #define CVSTFL "#tfl"
- ! #define CVSRFL "#rfl"
- ! #define CVSWFL "#wfl"
- ! #define CVSPREFIX ""
- ! #define CVSTEMP "#cXXXXXX"
-
- /* miscellaneous CVS defines */
- #define CVSEDITPREFIX "CVS: "
- #define CVSLCKAGE 600 /* 10-min old lock files cleaned up */
- #define CVSLCKSLEEP 15 /* wait 15 seconds before retrying */
- ! #define DFLT_RECORD "nul"
- ! #define BAKPREFIX "#"
- !
- ! #define DEVNULL "nul"
- ! #define CONSOLE "con" /* or "/dev/tty" */
-
- #define FALSE 0
- #define TRUE 1
- ***************
- *** 73,80 ****
- #define RCS_DIFF "rcsdiff"
- #define RCS_MERGE "rcsmerge"
- #define RCS_MERGE_PAT "^>>>>>>> " /* runs "grep" with this pattern */
- ! #define RCSID_PAT "'\\$Id.*\\$'" /* when committing files */
- ! #define RCSEXT ",v"
- #define RCSHEAD "head"
- #define RCSBRANCH "branch"
- #define RCSSYMBOL "symbols"
- --- 98,105 ----
- #define RCS_DIFF "rcsdiff"
- #define RCS_MERGE "rcsmerge"
- #define RCS_MERGE_PAT "^>>>>>>> " /* runs "grep" with this pattern */
- ! #define RCSID_PAT "\"\\$Id.*\\$\"" /* when committing files */
- ! #define RCSEXT Rcsext
- #define RCSHEAD "head"
- #define RCSBRANCH "branch"
- #define RCSSYMBOL "symbols"
- ***************
- *** 83,92 ****
- #define DATEFORM "%02d.%02d.%02d.%02d.%02d.%02d"
-
- /* Programs that cvs runs */
- ! #define DIFF "/bin/diff"
- ! #define GREP "/bin/grep"
- ! #define RM "/bin/rm"
- ! #define SORT "/usr/bin/sort"
-
- /*
- * Environment variable used by CVS
- --- 108,117 ----
- #define DATEFORM "%02d.%02d.%02d.%02d.%02d.%02d"
-
- /* Programs that cvs runs */
- ! #define DIFF "diff"
- ! #define GREP "grep"
- ! #define RM "rm"
- ! #define SORT "sort"
-
- /*
- * Environment variable used by CVS
- ***************
- *** 94,104 ****
- #define CVSREAD_ENV "CVSREAD" /* make files read-only */
- #define CVSREAD_DFLT FALSE /* writable files by default */
-
- #define RCSBIN_ENV "RCSBIN" /* RCS binary directory */
- ! #define RCSBIN_DFLT "/usr/local/bin" /* directory to find RCS progs */
-
- #define EDITOR_ENV "EDITOR" /* which editor to use */
- ! #define EDITOR_DFLT "/usr/ucb/vi" /* somewhat standard */
-
- #define CVSROOT_ENV "CVSROOT" /* source directory root */
- #define CVSROOT_DFLT NULL /* No dflt; must set for checkout */
- --- 119,133 ----
- #define CVSREAD_ENV "CVSREAD" /* make files read-only */
- #define CVSREAD_DFLT FALSE /* writable files by default */
-
- + #define TMPDIR_ENV "TMP" /* temp directory */
- + #define TMPDIR_DFLT "" /* directory to put temp files into */
- +
- #define RCSBIN_ENV "RCSBIN" /* RCS binary directory */
- ! #define RCSBIN_DFLT "/bin" /* directory to find RCS progs */
- ! #define RCSINIT_ENV "RCSINIT" /* RCS option settings */
-
- #define EDITOR_ENV "EDITOR" /* which editor to use */
- ! #define EDITOR_DFLT "emacs" /* somewhat standard */
-
- #define CVSROOT_ENV "CVSROOT" /* source directory root */
- #define CVSROOT_DFLT NULL /* No dflt; must set for checkout */
- ***************
- *** 116,125 ****
- * This is mainly for sizing arrays statically rather than
- * dynamically. 3000 seems plenty for now.
- */
- ! #define MAXFILEPERDIR 3000
- #define MAXLINELEN 1000 /* max input line from a file */
- #define MAXPROGLEN 30000 /* max program length to system() */
- ! #define MAXLISTLEN 20000 /* For [A-Z]list holders */
- #define MAXMESGLEN 1000 /* max RCS log message size */
-
- /*
- --- 145,154 ----
- * This is mainly for sizing arrays statically rather than
- * dynamically. 3000 seems plenty for now.
- */
- ! #define MAXFILEPERDIR 1000
- #define MAXLINELEN 1000 /* max input line from a file */
- #define MAXPROGLEN 30000 /* max program length to system() */
- ! #define MAXLISTLEN 10000 /* For [A-Z]list holders */
- #define MAXMESGLEN 1000 /* max RCS log message size */
-
- /*
- ***************
- *** 135,141 ****
- extern char User[], Repository[], SRepository[], Rcs[];
- extern char VN_User[], VN_Rcs[], TS_User[], TS_Rcs[];
- extern char Options[], Tag[], Date[], prog[];
- ! extern char *Rcsbin, *Editor, *CVSroot;
- extern int really_quiet, quiet;
- extern int use_editor;
- extern int cvswrite;
- --- 164,170 ----
- extern char User[], Repository[], SRepository[], Rcs[];
- extern char VN_User[], VN_Rcs[], TS_User[], TS_Rcs[];
- extern char Options[], Tag[], Date[], prog[];
- ! extern char *Tmpdir, *Rcsbin, *Editor, *CVSroot, *Rcsext;
- extern int really_quiet, quiet;
- extern int use_editor;
- extern int cvswrite;
- ***************
- *** 157,164 ****
- * Externs that are included in libc, but are used frequently
- * enough to warrant defining here.
- */
- - extern char *sprintf();
- extern char *optarg; /* for getopt() support */
- - extern char *getwd();
- - extern char *re_comp();
- extern int optind;
- --- 186,218 ----
- * Externs that are included in libc, but are used frequently
- * enough to warrant defining here.
- */
- extern char *optarg; /* for getopt() support */
- extern int optind;
- +
- + #define DBLKSIZ 1024
- + #define MAXPATHLEN 256
- + #define COPYBUFFER 16384
- +
- + #define R_OK 04
- + #define W_OK 02
- +
- + #define mkstemp(n) (mktemp(n), open(n, O_CREAT|O_TRUNC|O_RDWR, 0644))
- + #define getwd(d) getcwd(d, MAXPATHLEN)
- + #define geteuid() 0
- + #define gethostname(n, s) -1
- +
- + #define max(a,b) (((a) > (b)) ? (a) : (b))
- + #define min(a,b) (((a) < (b)) ? (a) : (b))
- +
- + #define WEXITSTATUS(x) (x & 255)
- +
- + #define index strchr
- + #define rindex strrchr
- +
- + #define mkdir(p, m) mkdir(p)
- +
- + #define bcmp(x, y, n) memcmp(x, y, n)
- + #define bcopy(s, d, n) memcpy(d, s, n)
- +
- + #include "proto.h"
- +
- diff -cb orig/diff.c src/diff.c
- *** orig/diff.c Sun Feb 23 15:02:26 1992
- --- src/diff.c Sun Feb 23 18:58:16 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: diff.c,v 1.12 89/11/19 23:40:34 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: diff.c,v 1.12 89/11/19 23:40:34 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 17,23 ****
- * currently modified files, as listed in the CVS.adm/Mod file.
- */
-
- - #include <sys/param.h>
- #include "cvs.h"
-
- diff(argc, argv)
- --- 17,22 ----
- ***************
- *** 91,98 ****
- }
- }
- if (fileargv[i][0] != '\0') {
- ! (void) sprintf(tmp, "%s/%s%s", CVSADM, CVSPREFIX, User);
- ! (void) sprintf(prog, "%s/%s -p -q -r%s %s > %s", Rcsbin,
- RCS_CO, revision, Rcs, tmp);
- if (system(prog) == 0 && xcmp(User, tmp) == 0)
- fileargv[i][0] = '\0';
- --- 90,97 ----
- }
- }
- if (fileargv[i][0] != '\0') {
- ! (void) sprintf(tmp, "%s%c%s%s", CVSADM, DIRSEP, CVSPREFIX, User);
- ! (void) sprintf(prog, "%s -p -q -r%s %s >%s",
- RCS_CO, revision, Rcs, tmp);
- if (system(prog) == 0 && xcmp(User, tmp) == 0)
- fileargv[i][0] = '\0';
- ***************
- *** 135,150 ****
- (void) fflush(stdout);
- }
- if (rev2[0] != '\0') {
- ! (void) sprintf(prog, "%s/%s %s -r%s -r%s %s", Rcsbin, RCS_DIFF,
- Options, rev1, rev2, Rcs);
- } else if (rev1[0] != '\0') {
- ! (void) sprintf(prog, "%s/%s %s -r%s %s", Rcsbin, RCS_DIFF,
- Options, rev1, Rcs);
- } else {
- ! (void) sprintf(prog, "%s/%s %s -r%s %s", Rcsbin, RCS_DIFF,
- Options, VN_User, Rcs);
- }
- (void) strcat(prog, " 2>&1");
- err += system(prog);
- (void) fflush(stdout);
- }
- --- 134,151 ----
- (void) fflush(stdout);
- }
- if (rev2[0] != '\0') {
- ! (void) sprintf(prog, "%s %s -r%s -r%s %s", RCS_DIFF,
- Options, rev1, rev2, Rcs);
- } else if (rev1[0] != '\0') {
- ! (void) sprintf(prog, "%s %s -r%s %s", RCS_DIFF,
- Options, rev1, Rcs);
- } else {
- ! (void) sprintf(prog, "%s %s -r%s %s", RCS_DIFF,
- Options, VN_User, Rcs);
- }
- + #ifndef OS2
- (void) strcat(prog, " 2>&1");
- + #endif
- err += system(prog);
- (void) fflush(stdout);
- }
- diff -cb orig/entries_file.c src/entries_file.c
- *** orig/entries_file.c Sun Feb 23 15:02:28 1992
- --- src/entries_file.c Sun Jan 19 15:35:44 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: entries_file.c,v 1.6 89/11/19 23:20:00 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: entries_file.c,v 1.6 89/11/19 23:20:00 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -cb orig/find_names.c src/find_names.c
- *** orig/find_names.c Sun Feb 23 15:02:28 1992
- --- src/find_names.c Sun Feb 23 16:49:12 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: find_names.c,v 1.11 89/11/19 23:20:02 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: find_names.c,v 1.11 89/11/19 23:20:02 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 20,28 ****
- * to indicate that the Repository should not be searched for new files.
- */
-
- - #include <sys/param.h>
- #include <sys/types.h>
- ! #include <dirent.h>
- #include "cvs.h"
-
- Find_Names(pargc, argv, which)
- --- 20,27 ----
- * to indicate that the Repository should not be searched for new files.
- */
-
- #include <sys/types.h>
- ! #include "dir.h"
- #include "cvs.h"
-
- Find_Names(pargc, argv, which)
- ***************
- *** 57,63 ****
- if (find_rcs(Repository, pargc, argv) != 0)
- error(1, "cannot open directory %s", Repository);
- if (which == ALLPLUSATTIC) {
- ! (void) sprintf(dir, "%s/%s", Repository, CVSATTIC);
- (void) find_rcs(dir, pargc, argv);
- }
- }
- --- 56,62 ----
- if (find_rcs(Repository, pargc, argv) != 0)
- error(1, "cannot open directory %s", Repository);
- if (which == ALLPLUSATTIC) {
- ! (void) sprintf(dir, "%s%c%s", Repository, DIRSEP, CVSATTIC);
- (void) find_rcs(dir, pargc, argv);
- }
- }
- ***************
- *** 93,101 ****
- int *pargc;
- char *argv[];
- {
- ! char *cp, line[50];
- struct dirent *dp;
- DIR *dirp;
-
- if ((dirp = opendir(dir)) == NULL)
- return (1);
- --- 92,101 ----
- int *pargc;
- char *argv[];
- {
- ! char *cp, line[256];
- struct dirent *dp;
- DIR *dirp;
- + FILE *fp;
-
- if ((dirp = opendir(dir)) == NULL)
- return (1);
- ***************
- *** 104,111 ****
- error(0, "%s", cp);
- while ((dp = readdir(dirp)) != NULL) {
- if (re_exec(dp->d_name)) {
- /* strip the ,v */
- ! *rindex(dp->d_name, ',') = '\0';
- addname(pargc, argv, dp->d_name);
- }
- }
- --- 104,122 ----
- error(0, "%s", cp);
- while ((dp = readdir(dirp)) != NULL) {
- if (re_exec(dp->d_name)) {
- + /* check if really a RCS file */
- + (void) sprintf(line, "%s%c%s", dir, DIRSEP, dp->d_name);
- + if ((fp = fopen(line, "r")) == NULL)
- + continue;
- + cp = fgets(line, strlen(RCSHEAD) + 1, fp);
- + fclose(fp);
- + if (cp == NULL)
- + continue;
- + if (strncmp(line, RCSHEAD, strlen(RCSHEAD)))
- + continue;
- /* strip the ,v */
- ! if ((cp = rindex(dp->d_name, ',')) != NULL)
- ! *cp = '\0';
- addname(pargc, argv, dp->d_name);
- }
- }
- ***************
- *** 127,133 ****
-
- for (i = 0; i < *pargc; i++) {
- if (strcmp(argv[i], name) == 0)
- ! return;
- }
- (*pargc)++;
- argv[i] = xmalloc(strlen(name) + 1);
- --- 138,144 ----
-
- for (i = 0; i < *pargc; i++) {
- if (strcmp(argv[i], name) == 0)
- ! return 0;
- }
- (*pargc)++;
- argv[i] = xmalloc(strlen(name) + 1);
- diff -cb orig/join.c src/join.c
- *** orig/join.c Sun Feb 23 15:02:30 1992
- --- src/join.c Sun Jan 19 22:20:26 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: join.c,v 1.4 89/11/19 23:40:36 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: join.c,v 1.4 89/11/19 23:40:36 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 93,99 ****
- char vers[50];
-
- (void) strcpy(User, file);
- ! (void) sprintf(Rcs, "%s/%s%s", Repository, User, RCSEXT);
- Version_Number(Rcs, Tag, Date, vers);
- if (vers[0] == '\0') {
- if (!quiet)
- --- 93,99 ----
- char vers[50];
-
- (void) strcpy(User, file);
- ! (void) sprintf(Rcs, "%s%c%s%s", Repository, DIRSEP, User, RCSEXT);
- Version_Number(Rcs, Tag, Date, vers);
- if (vers[0] == '\0') {
- if (!quiet)
- ***************
- *** 102,108 ****
- }
- (void) unlink(User);
- Scratch_Entry(User);
- ! (void) sprintf(prog, "%s/%s -j%s %s %s", Rcsbin, RCS_CO, vers, Rcs, User);
- if (system(prog) != 0) {
- if (!quiet)
- warn(0, "co of revision %s for %s failed", VN_Rcs, Rcs);
- --- 102,108 ----
- }
- (void) unlink(User);
- Scratch_Entry(User);
- ! (void) sprintf(prog, "%s -j%s %s %s", RCS_CO, vers, Rcs, User);
- if (system(prog) != 0) {
- if (!quiet)
- warn(0, "co of revision %s for %s failed", VN_Rcs, Rcs);
- diff -cb orig/locate_rcs.c src/locate_rcs.c
- *** orig/locate_rcs.c Sun Feb 23 15:02:30 1992
- --- src/locate_rcs.c Sun Jan 19 22:20:26 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: locate_rcs.c,v 1.5 89/11/19 23:20:05 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: locate_rcs.c,v 1.5 89/11/19 23:20:05 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 14,20 ****
- * Sets the global Rcs variable to the correct file.
- */
-
- - #include <sys/param.h>
- #include "cvs.h"
-
- Locate_RCS()
- --- 14,19 ----
- ***************
- *** 21,28 ****
- {
- char old[MAXPATHLEN];
-
- ! (void) sprintf(Rcs, "%s/%s%s", Repository, User, RCSEXT);
- ! (void) sprintf(old, "%s/%s/%s%s", Repository, CVSATTIC, User, RCSEXT);
- if (!isreadable(Rcs)) {
- if (isreadable(old)) {
- (void) strcpy(Rcs, old);
- --- 20,28 ----
- {
- char old[MAXPATHLEN];
-
- ! (void) sprintf(Rcs, "%s%c%s%s", Repository, DIRSEP, User, RCSEXT);
- ! (void) sprintf(old, "%s%c%s%c%s%s", Repository, DIRSEP, CVSATTIC,
- ! DIRSEP, User, RCSEXT);
- if (!isreadable(Rcs)) {
- if (isreadable(old)) {
- (void) strcpy(Rcs, old);
- diff -cb orig/log.c src/log.c
- *** orig/log.c Sun Feb 23 15:02:30 1992
- --- src/log.c Sun Jan 19 16:15:18 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: log.c,v 1.9 89/11/19 23:40:37 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: log.c,v 1.9 89/11/19 23:40:37 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 39,45 ****
- argc = fileargc;
- argv = fileargv;
- }
- ! (void) sprintf(prog, "%s/%s %s", Rcsbin, RCS_RLOG, Options);
- cp = prog + strlen(prog);
- for (i = 0; i < argc; i++) {
- (void) strcpy(User, argv[i]);
- --- 39,45 ----
- argc = fileargc;
- argv = fileargv;
- }
- ! (void) sprintf(prog, "%s %s", RCS_RLOG, Options);
- cp = prog + strlen(prog);
- for (i = 0; i < argc; i++) {
- (void) strcpy(User, argv[i]);
- diff -cb orig/main.c src/main.c
- *** orig/main.c Sun Feb 23 15:02:32 1992
- --- src/main.c Sun Feb 23 15:32:54 1992
- ***************
- *** 36,42 ****
- * 4/20/89
- */
-
- - #include <sys/param.h>
- #include "cvs.h"
- #include "patchlevel.h"
-
- --- 36,41 ----
- ***************
- *** 78,86 ****
- --- 77,87 ----
- /*
- * Defaults, for the environment variables that are not set
- */
- + char *Tmpdir = TMPDIR_DFLT;
- char *Rcsbin = RCSBIN_DFLT;
- char *Editor = EDITOR_DFLT;
- char *CVSroot = CVSROOT_DFLT;
- + char *Rcsext = "";
-
- main(argc, argv)
- int argc;
- ***************
- *** 94,100 ****
- /*
- * Just save the last component of the path for error messages
- */
- ! if ((progname = rindex(argv[0], '/')) == NULL)
- progname = argv[0];
- else
- progname++;
- --- 95,101 ----
- /*
- * Just save the last component of the path for error messages
- */
- ! if ((progname = rindex_sep(argv[0])) == NULL)
- progname = argv[0];
- else
- progname++;
- ***************
- *** 103,108 ****
- --- 104,111 ----
- * Query the environment variables up-front, so that
- * they can be overridden by command line arguments
- */
- + if ((cp = getenv(TMPDIR_ENV)) != NULL)
- + Tmpdir = cp;
- if ((cp = getenv(RCSBIN_ENV)) != NULL)
- Rcsbin = cp;
- if ((cp = getenv(EDITOR_ENV)) != NULL)
- ***************
- *** 109,114 ****
- --- 112,121 ----
- Editor = cp;
- if ((cp = getenv(CVSROOT_ENV)) != NULL)
- CVSroot = cp;
- + if ((cp = getenv(RCSINIT_ENV)) != NULL)
- + if ((cp = strstr(cp, "-x")) != NULL)
- + if ((cp = strstr(cp, ",v")) != NULL)
- + Rcsext = ",v";
- if (getenv(CVSREAD_ENV) != NULL)
- cvswrite = FALSE;
-
- ***************
- *** 166,172 ****
- * to stdout -- just leave it block buffered.
- */
- if (strcmp(cp, "patch") != 0)
- ! setlinebuf(stdout);
-
- if (strcmp(cp, "update") == 0)
- err += update(argc, argv);
- --- 173,179 ----
- * to stdout -- just leave it block buffered.
- */
- if (strcmp(cp, "patch") != 0)
- ! setvbuf(stdout, NULL, _IOLBF, 1024);
-
- if (strcmp(cp, "update") == 0)
- err += update(argc, argv);
- ***************
- *** 184,190 ****
- else if (strcmp(cp, "add") == 0)
- add(argc, argv);
- else if (strcmp(cp, "remove") == 0)
- ! remove(argc, argv);
- else if (strcmp(cp, "join") == 0)
- join(argc, argv);
- else if (strcmp(cp, "patch") == 0)
- --- 191,197 ----
- else if (strcmp(cp, "add") == 0)
- add(argc, argv);
- else if (strcmp(cp, "remove") == 0)
- ! _remove(argc, argv);
- else if (strcmp(cp, "join") == 0)
- join(argc, argv);
- else if (strcmp(cp, "patch") == 0)
- ***************
- *** 200,205 ****
- --- 207,218 ----
- static
- usage()
- {
- + (void) fputs("\nCVS 1.0, Copyright (c) 1989-91, Brian Berliner\n\n\
- + CVS may be copied only under the terms of the GNU General Public License,\n\
- + a copy of which can be found with the CVS 1.0 distribution kit.\n\n", stderr);
- + (void) sprintf(index(rcsid, '#'), "%d\n\n", PATCHLEVEL);
- + (void) fputs(rcsid, stderr);
- +
- (void) fprintf(stderr,
- "Usage: %s [cvs-options] command [command-options] [files...]\n",
- progname);
- diff -cb orig/maketime.c src/maketime.c
- *** orig/maketime.c Sun Feb 23 15:02:32 1992
- --- src/maketime.c Sun Jan 19 15:35:44 1992
- ***************
- *** 1,4 ****
- - #
- /*
- * MAKETIME derive 32-bit time value from TM structure.
- *
- --- 1,3 ----
- diff -cb orig/mkmodules.c src/mkmodules.c
- *** orig/mkmodules.c Sun Feb 23 15:02:32 1992
- --- src/mkmodules.c Sun Jan 19 22:05:02 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: mkmodules.c,v 1.9 89/11/19 23:20:10 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: mkmodules.c,v 1.9 89/11/19 23:20:10 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 14,23 ****
- * argument, which is the directory that the modules,v file lives in.
- */
-
- - #include <sys/param.h>
- #include <fcntl.h>
- #include <signal.h>
- - #include <ndbm.h>
- #include <ctype.h>
- #include "cvs.h"
-
- --- 14,21 ----
- ***************
- *** 37,43 ****
- /*
- * Just save the last component of the path for error messages
- */
- ! if ((progname = rindex(argv[0], '/')) == NULL)
- progname = argv[0];
- else
- progname++;
- --- 35,41 ----
- /*
- * Just save the last component of the path for error messages
- */
- ! if ((progname = rindex_sep(argv[0])) == NULL)
- progname = argv[0];
- else
- progname++;
- ***************
- *** 88,94 ****
- char *file;
- char *temp;
- {
- ! (void) sprintf(prog, "%s/%s -q -p %s > %s", Rcsbin, RCS_CO, file, temp);
- if (system(prog) != 0) {
- warn(0, "failed to check out %s file", file);
- return (1);
- --- 86,92 ----
- char *file;
- char *temp;
- {
- ! (void) sprintf(prog, "%s -q -p %s >%s", RCS_CO, file, temp);
- if (system(prog) != 0) {
- warn(0, "failed to check out %s file", file);
- return (1);
- ***************
- *** 189,198 ****
- char dotdir[50], dotpag[50];
- char bakdir[50], bakpag[50];
-
- ! (void) signal(SIGHUP, SIG_IGN); /* don't mess with me... */
- ! (void) signal(SIGINT, SIG_IGN);
- ! (void) signal(SIGQUIT, SIG_IGN);
- (void) signal(SIGTERM, SIG_IGN);
-
- (void) sprintf(dotdir, "%s.dir", CVSMODULE_FILE);
- (void) sprintf(dotpag, "%s.pag", CVSMODULE_FILE);
- --- 187,195 ----
- char dotdir[50], dotpag[50];
- char bakdir[50], bakpag[50];
-
- ! (void) signal(SIGINT, SIG_IGN); /* don't mess with me... */
- (void) signal(SIGTERM, SIG_IGN);
- + (void) signal(SIGBREAK, SIG_IGN);
-
- (void) sprintf(dotdir, "%s.dir", CVSMODULE_FILE);
- (void) sprintf(dotpag, "%s.pag", CVSMODULE_FILE);
- ***************
- *** 231,240 ****
- */
- void
- Lock_Cleanup(sig)
- {
- #ifdef lint
- sig = sig;
- ! #endif lint
- }
-
- static
- --- 228,238 ----
- */
- void
- Lock_Cleanup(sig)
- + int sig;
- {
- #ifdef lint
- sig = sig;
- ! #endif
- }
-
- static
- diff -cb orig/modules.c src/modules.c
- *** orig/modules.c Sun Feb 23 15:02:34 1992
- --- src/modules.c Sun Jan 19 22:20:26 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: modules.c,v 1.14.1.1 91/01/29 07:17:32 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: modules.c,v 1.14.1.1 91/01/29 07:17:32 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 23,31 ****
- * command line.
- */
-
- ! #include <sys/param.h>
- ! #include <sys/file.h>
- ! #include <ndbm.h>
- #include "cvs.h"
-
- extern int update_build_dirs;
- --- 23,29 ----
- * command line.
- */
-
- ! #include <fcntl.h>
- #include "cvs.h"
-
- extern int update_build_dirs;
- ***************
- *** 48,54 ****
- progname);
- error(0, "or specify the '-d' option to %s", progname);
- }
- ! (void) sprintf(mfile, "%s/%s", CVSroot, CVSROOTADM_MODULES);
- if ((db = dbm_open(mfile, O_RDONLY, 0666)) == NULL)
- warn(0, "warning: cannot open modules file %s", mfile);
- return (db);
- --- 46,52 ----
- progname);
- error(0, "or specify the '-d' option to %s", progname);
- }
- ! (void) sprintf(mfile, "%s%c%s", CVSroot, DIRSEP, CVSROOTADM_MODULES);
- if ((db = dbm_open(mfile, O_RDONLY, 0666)) == NULL)
- warn(0, "warning: cannot open modules file %s", mfile);
- return (db);
- ***************
- *** 77,83 ****
- char *msg;
- {
- char *checkin_prog = NULL, *checkout_prog = NULL, *tag_prog = NULL;
- ! char cwd[MAXPATHLEN], file[MAXPATHLEN];
- char *moduleargv[MAXFILEPERDIR];
- int moduleargc, just_file;
- datum key, val;
- --- 75,81 ----
- char *msg;
- {
- char *checkin_prog = NULL, *checkout_prog = NULL, *tag_prog = NULL;
- ! char cwd[MAXPATHLEN], file[MAXPATHLEN], value[MAXPATHLEN];
- char *moduleargv[MAXFILEPERDIR];
- int moduleargc, just_file;
- datum key, val;
- ***************
- *** 101,107 ****
- else
- val.dptr = NULL;
- if (val.dptr != NULL) {
- ! val.dptr[val.dsize] = '\0';
- } else {
- /*
- * Need to determine if the argument module name is a directory
- --- 99,106 ----
- else
- val.dptr = NULL;
- if (val.dptr != NULL) {
- ! strncpy(value, val.dptr, val.dsize);
- ! value[val.dsize] = '\0';
- } else {
- /*
- * Need to determine if the argument module name is a directory
- ***************
- *** 109,115 ****
- * and just_file accordingly
- */
- update_build_dirs = TRUE;
- ! (void) sprintf(file, "%s/%s", CVSroot, key.dptr);
- if (!isdir(file)) {
- (void) strcat(file, RCSEXT);
- if (!isfile(file)) {
- --- 108,114 ----
- * and just_file accordingly
- */
- update_build_dirs = TRUE;
- ! (void) sprintf(file, "%s%c%s", CVSroot, DIRSEP, key.dptr);
- if (!isdir(file)) {
- (void) strcat(file, RCSEXT);
- if (!isfile(file)) {
- ***************
- *** 128,134 ****
- * passed in module name to look like an actual module entry.
- */
- if (just_file == TRUE) {
- ! if ((cp = rindex(key.dptr, '/')) != NULL) {
- *cp++ = '\0';
- } else {
- cp = key.dptr;
- --- 127,133 ----
- * passed in module name to look like an actual module entry.
- */
- if (just_file == TRUE) {
- ! if ((cp = rindex_sep(key.dptr)) != NULL) {
- *cp++ = '\0';
- } else {
- cp = key.dptr;
- ***************
- *** 136,142 ****
- }
- (void) sprintf(file, "%s %s %s", key.dptr, key.dptr, cp);
- } else {
- ! (void) sprintf(file, "%s %s", key.dptr, val.dptr);
- }
- line2argv(&moduleargc, moduleargv, file);
- argc = moduleargc;
- --- 135,141 ----
- }
- (void) sprintf(file, "%s %s %s", key.dptr, key.dptr, cp);
- } else {
- ! (void) sprintf(file, "%s %s", key.dptr, value);
- }
- line2argv(&moduleargc, moduleargv, file);
- argc = moduleargc;
- ***************
- *** 160,166 ****
- break;
- case '?':
- warn(0, "modules file has invalid option for key %s value %s",
- ! key.dptr, val.dptr);
- err++;
- return (err);
- break;
- --- 159,165 ----
- break;
- case '?':
- warn(0, "modules file has invalid option for key %s value %s",
- ! key.dptr, value);
- err++;
- return (err);
- break;
- ***************
- *** 170,176 ****
- argv += optind;
- if (argc == 0) {
- warn(0, "modules file missing directory for key %s value %s",
- ! key.dptr, val.dptr);
- err++;
- return (err);
- }
- --- 169,175 ----
- argv += optind;
- if (argc == 0) {
- warn(0, "modules file missing directory for key %s value %s",
- ! key.dptr, value);
- err++;
- return (err);
- }
- ***************
- *** 222,228 ****
- if (!just_file && update_build_dirs == FALSE && argc == 1)
- update_build_dirs = TRUE;
- if (m_type == TAG || m_type == PATCH) {
- ! (void) sprintf(Repository, "%s/%s", CVSroot, argv[0]);
- if (chdir(Repository) < 0) {
- warn(1, "cannot chdir to %s", Repository);
- err++;
- --- 221,227 ----
- if (!just_file && update_build_dirs == FALSE && argc == 1)
- update_build_dirs = TRUE;
- if (m_type == TAG || m_type == PATCH) {
- ! (void) sprintf(Repository, "%s%c%s", CVSroot, DIRSEP, argv[0]);
- if (chdir(Repository) < 0) {
- warn(1, "cannot chdir to %s", Repository);
- err++;
- ***************
- *** 234,240 ****
- err++;
- return (err);
- }
- ! (void) sprintf(Repository, "%s/%s", CVSroot, argv[0]);
- if (!isdir(CVSADM)) {
- FILE *fp;
-
- --- 233,239 ----
- err++;
- return (err);
- }
- ! (void) sprintf(Repository, "%s%c%s", CVSroot, DIRSEP, argv[0]);
- if (!isdir(CVSADM)) {
- FILE *fp;
-
- ***************
- *** 277,283 ****
- char line[MAXLINELEN];
-
- (void) strcpy(User, argv[i]);
- ! (void) sprintf(Rcs, "%s/%s%s", Repository, User, RCSEXT);
- if (m_type == CHECKOUT) {
- Version_TS(Rcs, Tag, User);
- if (TS_User[0] == '\0') {
- --- 276,282 ----
- char line[MAXLINELEN];
-
- (void) strcpy(User, argv[i]);
- ! (void) sprintf(Rcs, "%s%c%s%s", Repository, DIRSEP, User, RCSEXT);
- if (m_type == CHECKOUT) {
- Version_TS(Rcs, Tag, User);
- if (TS_User[0] == '\0') {
- ***************
- *** 302,307 ****
- --- 301,307 ----
- FILE *fp;
- DBM *db;
- datum key, val;
- + char value[MAXPATHLEN];
-
- if ((db = open_module()) == NULL)
- error(0, "failed to cat the modules file");
- ***************
- *** 312,319 ****
- (void) fprintf(fp, "%-20s", key.dptr);
- val = dbm_fetch(db, key);
- if (val.dptr != NULL) {
- ! val.dptr[val.dsize] = '\0';
- ! (void) fprintf(fp, " %s\n", val.dptr);
- } else {
- (void) fprintf(fp, "\n");
- }
- --- 312,320 ----
- (void) fprintf(fp, "%-20s", key.dptr);
- val = dbm_fetch(db, key);
- if (val.dptr != NULL) {
- ! strncpy(value, val.dptr, val.dsize);
- ! value[val.dsize] = '\0';
- ! (void) fprintf(fp, " %s\n", value);
- } else {
- (void) fprintf(fp, "\n");
- }
- diff -cb orig/name_repository.c src/name_repository.c
- *** orig/name_repository.c Sun Feb 23 15:02:34 1992
- --- src/name_repository.c Sun Jan 19 22:05:02 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: name_repository.c,v 1.9 89/11/19 23:20:13 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: name_repository.c,v 1.9 89/11/19 23:20:13 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 14,20 ****
- * accordingly.
- */
-
- - #include <sys/param.h>
- #include "cvs.h"
-
- Name_Repository()
- --- 14,19 ----
- ***************
- *** 42,48 ****
- * an absolute one by tacking on the CVSROOT environment variable.
- * If the CVSROOT environment variable is not set, die now.
- */
- ! if (Repository[0] != '/') {
- if (CVSroot == NULL) {
- (void) fprintf(stderr,
- "%s: must set the CVSROOT environment variable\n",
- --- 41,47 ----
- * an absolute one by tacking on the CVSROOT environment variable.
- * If the CVSROOT environment variable is not set, die now.
- */
- ! if (!ISDIRSEP(Repository[0])) {
- if (CVSroot == NULL) {
- (void) fprintf(stderr,
- "%s: must set the CVSROOT environment variable\n",
- ***************
- *** 50,56 ****
- error(0, "or specify the '-d' option to %s", progname);
- }
- (void) strcpy(path, Repository);
- ! (void) sprintf(Repository, "%s/%s", CVSroot, path);
- }
- if (!isdir(Repository))
- error(0, "there is no repository %s", Repository);
- --- 49,55 ----
- error(0, "or specify the '-d' option to %s", progname);
- }
- (void) strcpy(path, Repository);
- ! (void) sprintf(Repository, "%s%c%s", CVSroot, DIRSEP, path);
- }
- if (!isdir(Repository))
- error(0, "there is no repository %s", Repository);
- diff -cb orig/no_difference.c src/no_difference.c
- *** orig/no_difference.c Sun Feb 23 15:02:36 1992
- --- src/no_difference.c Sun Jan 19 22:20:26 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: no_difference.c,v 1.7.1.1 91/01/29 07:18:06 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: no_difference.c,v 1.7.1.1 91/01/29 07:18:06 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 22,28 ****
- * Returns non-zero on error.
- */
-
- - #include <sys/param.h>
- #include "cvs.h"
-
- No_Difference(doGlist)
- --- 22,27 ----
- ***************
- *** 30,38 ****
- {
- char tmp[MAXPATHLEN];
-
- ! (void) sprintf(tmp, "%s/%s%s", CVSADM, CVSPREFIX, User);
- ! (void) sprintf(prog, "%s/%s -p -q -r%s %s > %s", Rcsbin, RCS_CO,
- ! VN_User, Rcs, tmp);
- if (system(prog) == 0) {
- if (xcmp(User, tmp) == 0) {
- if (cvswrite == FALSE)
- --- 29,36 ----
- {
- char tmp[MAXPATHLEN];
-
- ! (void) sprintf(tmp, "%s%c%s%s", CVSADM, DIRSEP, CVSPREFIX, User);
- ! (void) sprintf(prog, "%s -p -q -r%s %s >%s", RCS_CO, VN_User, Rcs, tmp);
- if (system(prog) == 0) {
- if (xcmp(User, tmp) == 0) {
- if (cvswrite == FALSE)
- diff -cb orig/options.c src/options.c
- *** orig/options.c Sun Feb 23 15:02:36 1992
- --- src/options.c Sun Jan 19 15:35:44 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: options.c,v 1.5 89/11/19 23:20:18 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: options.c,v 1.5 89/11/19 23:20:18 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -cb orig/patch.c src/patch.c
- *** orig/patch.c Sun Feb 23 15:02:36 1992
- --- src/patch.c Sun Feb 23 17:03:58 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: patch.c,v 1.6.1.1 91/01/18 12:18:45 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: patch.c,v 1.6.1.1 91/01/18 12:18:45 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 15,25 ****
- * specify the release as either a date or a revision number.
- */
-
- - #include <sys/param.h>
- #include <time.h>
- ! #include <ndbm.h>
- ! #include <dirent.h>
- #include <ctype.h>
- #include "cvs.h"
-
- extern char update_dir[];
- --- 15,26 ----
- * specify the release as either a date or a revision number.
- */
-
- #include <time.h>
- ! #include <fcntl.h>
- ! #include <signal.h>
- #include <ctype.h>
- + #include <sys/types.h>
- + #include "dir.h"
- #include "cvs.h"
-
- extern char update_dir[];
- ***************
- *** 30,36 ****
- static int patch_short = 0;
- static int toptwo_diffs = 0;
- static char rev1[50], rev2[50], date1[50], date2[50];
- ! static char tmpfile1[50], tmpfile2[50], tmpfile3[50];
-
- void patch_cleanup();
-
- --- 31,37 ----
- static int patch_short = 0;
- static int toptwo_diffs = 0;
- static char rev1[50], rev2[50], date1[50], date2[50];
- ! static char tmpfile1[MAXPATHLEN], tmpfile2[MAXPATHLEN], tmpfile3[MAXPATHLEN];
-
- void patch_cleanup();
-
- ***************
- *** 107,116 ****
- if (datecmp(date1, date2) >= 0)
- error(0, "second date must come after first date!");
- }
- - (void) signal(SIGHUP, patch_cleanup);
- (void) signal(SIGINT, patch_cleanup);
- - (void) signal(SIGQUIT, patch_cleanup);
- (void) signal(SIGTERM, patch_cleanup);
- db = open_module();
- for (i = 0; i < argc; i++)
- err += do_module(db, argv[i], PATCH, "Examining");
- --- 108,116 ----
- if (datecmp(date1, date2) >= 0)
- error(0, "second date must come after first date!");
- }
- (void) signal(SIGINT, patch_cleanup);
- (void) signal(SIGTERM, patch_cleanup);
- + (void) signal(SIGBREAK, patch_cleanup);
- db = open_module();
- for (i = 0; i < argc; i++)
- err += do_module(db, argv[i], PATCH, "Examining");
- ***************
- *** 149,156 ****
- } else while ((dp = readdir(dirp)) != NULL) {
- if (strcmp(dp->d_name, ".") == 0 ||
- strcmp(dp->d_name, "..") == 0 ||
- ! strcmp(dp->d_name, CVSATTIC) == 0 ||
- ! strcmp(dp->d_name, CVSLCK) == 0)
- continue;
- if (isdir(dp->d_name) && patch_recursive) {
- char cwd[MAXPATHLEN];
- --- 149,156 ----
- } else while ((dp = readdir(dirp)) != NULL) {
- if (strcmp(dp->d_name, ".") == 0 ||
- strcmp(dp->d_name, "..") == 0 ||
- ! stricmp(dp->d_name, CVSATTIC) == 0 ||
- ! stricmp(dp->d_name, CVSLCK) == 0)
- continue;
- if (isdir(dp->d_name) && patch_recursive) {
- char cwd[MAXPATHLEN];
- ***************
- *** 163,169 ****
- if (update_dir[0] == '\0') {
- (void) strcpy(update_dir, dp->d_name);
- } else {
- ! (void) strcat(update_dir, "/");
- (void) strcat(update_dir, dp->d_name);
- }
- if (!quiet) {
- --- 163,169 ----
- if (update_dir[0] == '\0') {
- (void) strcpy(update_dir, dp->d_name);
- } else {
- ! (void) strcat(update_dir, DIRSEPSTR);
- (void) strcat(update_dir, dp->d_name);
- }
- if (!quiet) {
- ***************
- *** 176,182 ****
- continue;
- }
- err += patched((char *)0);
- ! if ((cp = rindex(update_dir, '/')) != NULL)
- *cp = '\0';
- else
- update_dir[0] = '\0';
- --- 176,182 ----
- continue;
- }
- err += patched((char *)0);
- ! if ((cp = rindex_sep(update_dir)) != NULL)
- *cp = '\0';
- else
- update_dir[0] = '\0';
- ***************
- *** 225,231 ****
- if (patch_short) {
- printf("File ");
- if (update_dir[0] != '\0')
- ! printf("%s/", update_dir);
- if (vers_tag[0] == '\0')
- printf("%s is new; current revision %s\n", rcs, vers_head);
- else
- --- 225,231 ----
- if (patch_short) {
- printf("File ");
- if (update_dir[0] != '\0')
- ! printf("%s%c", update_dir, DIRSEP);
- if (vers_tag[0] == '\0')
- printf("%s is new; current revision %s\n", rcs, vers_head);
- else
- ***************
- *** 233,241 ****
- rcs, vers_tag, vers_head);
- return (0);
- }
- ! (void) strcpy(tmpfile1, "/tmp/cvspatch.XXXXXX");
- ! (void) strcpy(tmpfile2, "/tmp/cvspatch.XXXXXX");
- ! (void) strcpy(tmpfile3, "/tmp/cvspatch.XXXXXX");
- fd1 = mkstemp(tmpfile1); (void) close(fd1);
- fd2 = mkstemp(tmpfile2); (void) close(fd2);
- fd3 = mkstemp(tmpfile3); (void) close(fd3);
- --- 233,241 ----
- rcs, vers_tag, vers_head);
- return (0);
- }
- ! (void) sprintf(tmpfile1, "%s%ccpXXXXXX", Tmpdir, DIRSEP);
- ! (void) sprintf(tmpfile2, "%s%ccpXXXXXX", Tmpdir, DIRSEP);
- ! (void) sprintf(tmpfile3, "%s%ccpXXXXXX", Tmpdir, DIRSEP);
- fd1 = mkstemp(tmpfile1); (void) close(fd1);
- fd2 = mkstemp(tmpfile2); (void) close(fd2);
- fd3 = mkstemp(tmpfile3); (void) close(fd3);
- ***************
- *** 245,251 ****
- goto out;
- }
- if (vers_tag[0] != '\0') {
- ! (void) sprintf(prog, "%s/%s -p -q -r%s %s > %s", Rcsbin, RCS_CO,
- vers_tag, rcs, tmpfile1);
- if (system(prog) != 0) {
- if (!really_quiet)
- --- 245,251 ----
- goto out;
- }
- if (vers_tag[0] != '\0') {
- ! (void) sprintf(prog, "%s -p -q -r%s %s >%s", RCS_CO,
- vers_tag, rcs, tmpfile1);
- if (system(prog) != 0) {
- if (!really_quiet)
- ***************
- *** 257,263 ****
- ret = 1;
- goto out;
- }
- ! (void) sprintf(prog, "%s/%s -p -q -r%s %s > %s", Rcsbin, RCS_CO,
- vers_head, rcs, tmpfile2);
- if (system(prog) != 0) {
- if (!really_quiet)
- --- 257,263 ----
- ret = 1;
- goto out;
- }
- ! (void) sprintf(prog, "%s -p -q -r%s %s >%s", RCS_CO,
- vers_head, rcs, tmpfile2);
- if (system(prog) != 0) {
- if (!really_quiet)
- ***************
- *** 295,301 ****
- goto out;
- }
- if (CVSroot != NULL)
- ! (void) sprintf(strippath, "%s/", CVSroot);
- else
- (void) strcpy(strippath, REPOS_STRIP);
- if (strncmp(rcs, strippath, strlen(strippath)) == 0)
- --- 295,301 ----
- goto out;
- }
- if (CVSroot != NULL)
- ! (void) sprintf(strippath, "%s%c", CVSroot, DIRSEP);
- else
- (void) strcpy(strippath, REPOS_STRIP);
- if (strncmp(rcs, strippath, strlen(strippath)) == 0)
- ***************
- *** 303,318 ****
- *rindex(rcs, ',') = '\0';
- if (vers_tag[0] != '\0') {
- (void) sprintf(file1, "%s%s%s:%s", update_dir,
- ! update_dir[0] ? "/" : "", rcs, vers_tag);
- } else {
- (void) strcpy(file1, DEVNULL);
- }
- (void) sprintf(file2, "%s%s%s:%s", update_dir,
- ! update_dir[0] ? "/" : "", rcs, vers_head);
- printf("diff -c %s %s\n", file1, file2);
- printf("*** %s%s--- ", file1, cp1);
- if (update_dir[0] != '\0')
- ! printf("%s/", update_dir);
- printf("%s%s", rcs, cp2);
- while (fgets(line1, sizeof(line1), fp) != NULL)
- printf("%s", line1);
- --- 303,319 ----
- *rindex(rcs, ',') = '\0';
- if (vers_tag[0] != '\0') {
- (void) sprintf(file1, "%s%s%s:%s", update_dir,
- ! update_dir[0] ? DIRSEPSTR : "", rcs, vers_tag);
- } else {
- (void) strcpy(file1, DEVNULL);
- }
- (void) sprintf(file2, "%s%s%s:%s", update_dir,
- ! update_dir[0] ? DIRSEPSTR : "", rcs, vers_head);
- printf("diff -c %s %s\n", file1, file2);
- printf("*** %s%s--- ", file1, cp1);
- + /* but these dates pointed to by cp1 and cp2 aren't very useful ?!? */
- if (update_dir[0] != '\0')
- ! printf("%s%c", update_dir, DIRSEP);
- printf("%s%s", rcs, cp2);
- while (fgets(line1, sizeof(line1), fp) != NULL)
- printf("%s", line1);
- ***************
- *** 383,388 ****
- --- 384,390 ----
- }
- }
- (void) fclose(fp);
- + strcpy(date, cp);
- return (ret);
- }
-
- Only in src: pc-files
- diff -cb orig/register.c src/register.c
- *** orig/register.c Sun Feb 23 15:02:36 1992
- --- src/register.c Sun Jan 19 15:35:44 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: register.c,v 1.5 89/11/19 23:20:21 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: register.c,v 1.5 89/11/19 23:20:21 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -cb orig/remove.c src/remove.c
- *** orig/remove.c Sun Feb 23 15:02:38 1992
- --- src/remove.c Sun Feb 23 18:10:58 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: remove.c,v 1.9 89/11/19 23:40:43 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: remove.c,v 1.9 89/11/19 23:40:43 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 19,28 ****
- * for "remove" to work correctly.
- */
-
- - #include <sys/param.h>
- #include "cvs.h"
-
- ! remove(argc, argv)
- int argc;
- char *argv[];
- {
- --- 19,27 ----
- * for "remove" to work correctly.
- */
-
- #include "cvs.h"
-
- ! _remove(argc, argv)
- int argc;
- char *argv[];
- {
- ***************
- *** 53,62 ****
- * the entries file.
- */
- Scratch_Entry(User);
- ! (void) sprintf(fname, "%s/%s%s", CVSADM, User, CVSEXT_OPT);
- (void) unlink(fname);
- ! (void) sprintf(fname, "%s/%s%s", CVSADM, User, CVSEXT_LOG);
- (void) unlink(fname);
- } else if (VN_User[0] == '-') {
- /*
- * It's already been flagged for removal, nothing more to do.
- --- 52,63 ----
- * the entries file.
- */
- Scratch_Entry(User);
- ! (void) sprintf(fname, "%s%c%s", CVSEXT_OPT, DIRSEP, User);
- (void) unlink(fname);
- ! (void) rmdir(CVSEXT_OPT);
- ! (void) sprintf(fname, "%s%c%s", CVSEXT_LOG, DIRSEP, User);
- (void) unlink(fname);
- + (void) rmdir(CVSEXT_LOG);
- } else if (VN_User[0] == '-') {
- /*
- * It's already been flagged for removal, nothing more to do.
- diff -cb orig/scratch_entry.c src/scratch_entry.c
- *** orig/scratch_entry.c Sun Feb 23 15:02:38 1992
- --- src/scratch_entry.c Sun Jan 19 15:35:44 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: scratch_entry.c,v 1.5 89/11/19 23:20:24 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: scratch_entry.c,v 1.5 89/11/19 23:20:24 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 14,20 ****
- * Entries file is placed in Entries.backup.
- */
-
- ! #include <sys/param.h>
- #include "cvs.h"
-
- Scratch_Entry(fname)
- --- 14,20 ----
- * Entries file is placed in Entries.backup.
- */
-
- ! #include <stdlib.h>
- #include "cvs.h"
-
- Scratch_Entry(fname)
- ***************
- *** 29,35 ****
- fpout = open_file(CVSADM_ENT, "w+");
- while (fgets(line, sizeof(line), fpin) != NULL) {
- if ((cpend = rindex(line, '|')) && (cp = rindex(line, ' ')) &&
- ! (cp++) && strncmp(fname, cp, MAX((cpend-cp), strlen(fname))) == 0)
- continue;
- if (fputs(line, fpout) == EOF)
- error(1, "cannot write file %s", CVSADM_ENT);
- --- 29,35 ----
- fpout = open_file(CVSADM_ENT, "w+");
- while (fgets(line, sizeof(line), fpin) != NULL) {
- if ((cpend = rindex(line, '|')) && (cp = rindex(line, ' ')) &&
- ! (cp++) && strncmp(fname, cp, max((cpend-cp), strlen(fname))) == 0)
- continue;
- if (fputs(line, fpout) == EOF)
- error(1, "cannot write file %s", CVSADM_ENT);
- diff -cb orig/set_lock.c src/set_lock.c
- *** orig/set_lock.c Sun Feb 23 15:02:38 1992
- --- src/set_lock.c Sun Feb 23 18:23:58 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: set_lock.c,v 1.8 89/11/19 23:20:26 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: set_lock.c,v 1.8 89/11/19 23:20:26 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 15,25 ****
- * Maybe some day, others will too.
- */
-
- - #include <sys/param.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <signal.h>
- ! #include <dirent.h>
- #include "cvs.h"
-
- static char lckdir[MAXPATHLEN], lckrfl[MAXPATHLEN], lckwfl[MAXPATHLEN];
- --- 15,24 ----
- * Maybe some day, others will too.
- */
-
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <signal.h>
- ! #include "dir.h"
- #include "cvs.h"
-
- static char lckdir[MAXPATHLEN], lckrfl[MAXPATHLEN], lckwfl[MAXPATHLEN];
- ***************
- *** 68,84 ****
- time_t now;
- FILE *fp;
-
- ! (void) sprintf(lckdir, "%s/%s", Repository, CVSLCK);
- ! (void) sprintf(lckrfl, "%s/%s.%d", Repository, CVSTFL, getpid());
- ! (void) signal(SIGHUP, Lock_Cleanup);
- (void) signal(SIGINT, Lock_Cleanup);
- - (void) signal(SIGQUIT, Lock_Cleanup);
- (void) signal(SIGTERM, Lock_Cleanup);
- if ((fp = fopen(lckrfl, "w+")) != NULL) {
- (void) fclose(fp);
- (void) unlink(lckrfl);
- set_lock(lckdir);
- ! (void) sprintf(lckrfl, "%s/%s.%d", Repository, CVSRFL, getpid());
- if ((fp = fopen(lckrfl, "w+")) == NULL)
- warn(1, "cannot create read lock file %s", lckrfl);
- else
- --- 67,82 ----
- time_t now;
- FILE *fp;
-
- ! (void) sprintf(lckdir, "%s%c%s", Repository, DIRSEP, CVSLCK);
- ! (void) sprintf(lckrfl, "%s%c%s%04x", Repository, DIRSEP, CVSTFL, getpid());
- (void) signal(SIGINT, Lock_Cleanup);
- (void) signal(SIGTERM, Lock_Cleanup);
- + (void) signal(SIGBREAK, Lock_Cleanup);
- if ((fp = fopen(lckrfl, "w+")) != NULL) {
- (void) fclose(fp);
- (void) unlink(lckrfl);
- set_lock(lckdir);
- ! (void) sprintf(lckrfl, "%s%c%s%04x", Repository, DIRSEP, CVSRFL, getpid());
- if ((fp = fopen(lckrfl, "w+")) == NULL)
- warn(1, "cannot create read lock file %s", lckrfl);
- else
- ***************
- *** 113,130 ****
- {
- FILE *fp;
-
- ! (void) sprintf(lckdir, "%s/%s", Repository, CVSLCK);
- ! (void) sprintf(lckrfl, "%s/%s.%d", Repository, CVSTFL, getpid());
- ! (void) sprintf(lckwfl, "%s/%s.%d", Repository, CVSWFL, getpid());
- ! (void) signal(SIGHUP, Lock_Cleanup);
- (void) signal(SIGINT, Lock_Cleanup);
- - (void) signal(SIGQUIT, Lock_Cleanup);
- (void) signal(SIGTERM, Lock_Cleanup);
- if ((fp = fopen(lckrfl, "w+")) == NULL)
- error(1, "you have no write permission in %s", Repository);
- (void) fclose(fp);
- (void) unlink(lckrfl);
- ! (void) sprintf(lckrfl, "%s/%s.%d", Repository, CVSRFL, getpid());
- set_lock(lckdir);
- if ((fp = fopen(lckwfl, "w+")) == NULL)
- warn(1, "cannot create write lock file %s", lckwfl);
- --- 111,127 ----
- {
- FILE *fp;
-
- ! (void) sprintf(lckdir, "%s%c%s", Repository, DIRSEP, CVSLCK);
- ! (void) sprintf(lckrfl, "%s%c%s%04x", Repository, DIRSEP, CVSTFL, getpid());
- ! (void) sprintf(lckwfl, "%s%c%s%04x", Repository, DIRSEP, CVSWFL, getpid());
- (void) signal(SIGINT, Lock_Cleanup);
- (void) signal(SIGTERM, Lock_Cleanup);
- + (void) signal(SIGBREAK, Lock_Cleanup);
- if ((fp = fopen(lckrfl, "w+")) == NULL)
- error(1, "you have no write permission in %s", Repository);
- (void) fclose(fp);
- (void) unlink(lckrfl);
- ! (void) sprintf(lckrfl, "%s%c%s%04x", Repository, DIRSEP, CVSRFL, getpid());
- set_lock(lckdir);
- if ((fp = fopen(lckwfl, "w+")) == NULL)
- warn(1, "cannot create write lock file %s", lckwfl);
- ***************
- *** 175,181 ****
- * seconds ago, try to clean-up the lock file, and if
- * successful, re-open the directory and try again.
- */
- ! (void) sprintf(line, "%s/%s", Repository, dp->d_name);
- if (stat(line, &sb) != -1 && now >= (sb.st_ctime + CVSLCKAGE)) {
- if (unlink(line) != -1) {
- (void) closedir(dirp);
- --- 172,178 ----
- * seconds ago, try to clean-up the lock file, and if
- * successful, re-open the directory and try again.
- */
- ! (void) sprintf(line, "%s%c%s", Repository, DIRSEP, dp->d_name);
- if (stat(line, &sb) != -1 && now >= (sb.st_ctime + CVSLCKAGE)) {
- if (unlink(line) != -1) {
- (void) closedir(dirp);
- ***************
- *** 231,234 ****
- --- 228,232 ----
- }
- }
- }
- +
-
- diff -cb orig/status.c src/status.c
- *** orig/status.c Sun Feb 23 15:02:38 1992
- --- src/status.c Sun Jan 19 15:35:44 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: status.c,v 1.13 89/11/19 23:40:44 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: status.c,v 1.13 89/11/19 23:40:44 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -cb orig/subr.c src/subr.c
- *** orig/subr.c Sun Feb 23 15:02:40 1992
- --- src/subr.c Sun Jan 19 22:54:22 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: subr.c,v 1.14.1.2 91/01/29 19:46:20 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: subr.c,v 1.14.1.2 91/01/29 19:46:20 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 13,20 ****
-
- #include <sys/types.h>
- #include <sys/stat.h>
- ! #include <sys/file.h>
- ! #include <varargs.h>
- #include "cvs.h"
-
- /*
- --- 13,20 ----
-
- #include <sys/types.h>
- #include <sys/stat.h>
- ! #include <fcntl.h>
- ! #include <stdarg.h>
- #include "cvs.h"
-
- /*
- ***************
- *** 21,36 ****
- * Send a "printf" format string to stderr and die, calling the
- * defined exit function first, if necessary
- */
- ! error(doperror, fmt, va_alist)
- int doperror;
- char *fmt;
- - va_dcl
- {
- - extern int errno;
- va_list x1;
- int err = errno;
-
- ! va_start(x1);
- (void) fprintf(stderr, "%s: ", progname);
- (void) vfprintf(stderr, fmt, x1);
- if (doperror) {
- --- 21,34 ----
- * Send a "printf" format string to stderr and die, calling the
- * defined exit function first, if necessary
- */
- ! error(doperror, fmt, ...)
- int doperror;
- char *fmt;
- {
- va_list x1;
- int err = errno;
-
- ! va_start(x1, fmt);
- (void) fprintf(stderr, "%s: ", progname);
- (void) vfprintf(stderr, fmt, x1);
- if (doperror) {
- ***************
- *** 49,64 ****
- * Like error() above, but just display the message to stderr,
- * without dying or running the exit function.
- */
- ! warn(doperror, fmt, va_alist)
- int doperror;
- char *fmt;
- - va_dcl
- {
- - extern int errno;
- va_list x1;
- int err = errno;
-
- ! va_start(x1);
- (void) fprintf(stderr, "%s: ", progname);
- (void) vfprintf(stderr, fmt, x1);
- if (doperror) {
- --- 47,60 ----
- * Like error() above, but just display the message to stderr,
- * without dying or running the exit function.
- */
- ! warn(doperror, fmt, ...)
- int doperror;
- char *fmt;
- {
- va_list x1;
- int err = errno;
-
- ! va_start(x1, fmt);
- (void) fprintf(stderr, "%s: ", progname);
- (void) vfprintf(stderr, fmt, x1);
- if (doperror) {
- ***************
- *** 82,102 ****
- char *to;
- {
- struct stat sb;
- ! int fdin, fdout;
- char *buf;
-
- ! if ((fdin = open(from, O_RDONLY)) < 0)
- error(1, "cannot open %s for copying", from);
- if (fstat(fdin, &sb) < 0)
- error(1, "cannot fstat %s", from);
- ! if ((fdout = creat(to, (int) sb.st_mode & 07777)) < 0)
- error(1, "cannot create %s for copying", to);
- if (sb.st_size > 0) {
- ! buf = xmalloc((int)sb.st_size);
- ! if (read(fdin, buf, (int)sb.st_size) != (int)sb.st_size)
- error(1, "cannot read file %s for copying", from);
- ! if (write(fdout, buf, (int)sb.st_size) != (int)sb.st_size)
- error(1, "cannot write file %s for copying", to);
- free(buf);
- }
- (void) close(fdin);
- --- 78,102 ----
- char *to;
- {
- struct stat sb;
- ! int fdin, fdout, chunk;
- char *buf;
-
- ! if ((fdin = open(from, O_RDONLY|O_BINARY)) < 0)
- error(1, "cannot open %s for copying", from);
- if (fstat(fdin, &sb) < 0)
- error(1, "cannot fstat %s", from);
- ! if ((fdout = open(to, O_CREAT|O_EXCL|O_RDWR|O_BINARY,
- ! (int) sb.st_mode & 07777)) < 0)
- error(1, "cannot create %s for copying", to);
- if (sb.st_size > 0) {
- ! buf = xmalloc(COPYBUFFER);
- ! while ( (chunk = (int) min(sb.st_size, COPYBUFFER)) > 0 ) {
- ! if (read(fdin, buf, chunk) != chunk)
- error(1, "cannot read file %s for copying", from);
- ! if (write(fdout, buf, chunk) != chunk)
- error(1, "cannot write file %s for copying", to);
- + sb.st_size -= chunk;
- + }
- free(buf);
- }
- (void) close(fdin);
- ***************
- *** 199,205 ****
- xmalloc(bytes)
- int bytes;
- {
- - extern char *malloc();
- char *cp;
-
- if (bytes <= 0)
- --- 199,204 ----
- ***************
- *** 239,251 ****
- /* Some UNIX distributions don't include these in their stat.h */
- #ifndef S_IWRITE
- #define S_IWRITE 0000200 /* write permission, owner */
- ! #endif !S_IWRITE
- #ifndef S_IWGRP
- #define S_IWGRP 0000020 /* write permission, grougroup */
- ! #endif !S_IWGRP
- #ifndef S_IWOTH
- #define S_IWOTH 0000002 /* write permission, other */
- ! #endif !S_IWOTH
-
- /*
- * Change the mode of a file, either adding write permissions, or
- --- 238,250 ----
- /* Some UNIX distributions don't include these in their stat.h */
- #ifndef S_IWRITE
- #define S_IWRITE 0000200 /* write permission, owner */
- ! #endif
- #ifndef S_IWGRP
- #define S_IWGRP 0000020 /* write permission, grougroup */
- ! #endif
- #ifndef S_IWOTH
- #define S_IWOTH 0000002 /* write permission, other */
- ! #endif
-
- /*
- * Change the mode of a file, either adding write permissions, or
- ***************
- *** 261,267 ****
-
- if (stat(fname, &sb) < 0) {
- warn(1, "cannot stat %s", fname);
- ! return;
- }
- if (writable) {
- oumask = umask(0);
- --- 260,266 ----
-
- if (stat(fname, &sb) < 0) {
- warn(1, "cannot stat %s", fname);
- ! return 0;
- }
- if (writable) {
- oumask = umask(0);
- ***************
- *** 281,286 ****
- --- 280,286 ----
- char *from;
- char *to;
- {
- + (void) unlink(to);
- if (rename(from, to) < 0)
- error(1, "cannot rename file %s to %s", from, to);
- }
- ***************
- *** 300,310 ****
- register char *buf1, *buf2;
- struct stat sb;
- off_t size;
- ! int ret, fd1, fd2;
-
- ! if ((fd1 = open(file1, O_RDONLY)) < 0)
- error(1, "cannot open file %s for comparing", file1);
- ! if ((fd2 = open(file2, O_RDONLY)) < 0)
- error(1, "cannot open file %s for comparing", file2);
- if (fstat(fd1, &sb) < 0)
- error(1, "cannot fstat %s", file1);
- --- 300,310 ----
- register char *buf1, *buf2;
- struct stat sb;
- off_t size;
- ! int ret, fd1, fd2, chunk;
-
- ! if ((fd1 = open(file1, O_RDONLY|O_BINARY)) < 0)
- error(1, "cannot open file %s for comparing", file1);
- ! if ((fd2 = open(file2, O_RDONLY|O_BINARY)) < 0)
- error(1, "cannot open file %s for comparing", file2);
- if (fstat(fd1, &sb) < 0)
- error(1, "cannot fstat %s", file1);
- ***************
- *** 315,327 ****
- if (size == 0)
- ret = 0;
- else {
- ! buf1 = xmalloc((int)size);
- ! buf2 = xmalloc((int)size);
- ! if (read(fd1, buf1, (int)size) != (int)size)
- error(1, "cannot read file %s cor comparing", file1);
- ! if (read(fd2, buf2, (int)size) != (int)size)
- error(1, "cannot read file %s for comparing", file2);
- ! ret = bcmp(buf1, buf2, (int)size);
- free(buf1);
- free(buf2);
- }
- --- 315,331 ----
- if (size == 0)
- ret = 0;
- else {
- ! buf1 = xmalloc(COPYBUFFER);
- ! buf2 = xmalloc(COPYBUFFER);
- ! while ( (chunk = (int) min(sb.st_size, COPYBUFFER)) > 0 ) {
- ! if (read(fd1, buf1, chunk) != chunk)
- error(1, "cannot read file %s cor comparing", file1);
- ! if (read(fd2, buf2, chunk) != chunk)
- error(1, "cannot read file %s for comparing", file2);
- ! if ( ret = bcmp(buf1, buf2, chunk) )
- ! break;
- ! sb.st_size -= chunk;
- ! }
- free(buf1);
- free(buf2);
- }
- ***************
- *** 382,384 ****
- --- 386,410 ----
- }
- return (dots);
- }
- +
- +
- + #ifdef OS2
- + char *index_sep(char *path)
- + {
- + char *p1 = strchr(path, '\\');
- + char *p2 = strchr(path, '/');
- + if ( !p1 ) return p2;
- + if ( !p2 ) return p1;
- + return (p1 > p2) ? p2 : p1;
- + }
- +
- +
- + char *rindex_sep(char *path)
- + {
- + char *p1 = strrchr(path, '\\');
- + char *p2 = strrchr(path, '/');
- + if ( !p1 ) return p2;
- + if ( !p2 ) return p1;
- + return (p1 > p2) ? p1 : p2;
- + }
- + #endif
- diff -cb orig/tag.c src/tag.c
- *** orig/tag.c Sun Feb 23 15:02:40 1992
- --- src/tag.c Sun Feb 23 19:11:06 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: tag.c,v 1.19.1.2 91/01/29 19:45:54 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: tag.c,v 1.19.1.2 91/01/29 19:45:54 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 14,23 ****
- * of RCS files. Uses the modules database, if necessary.
- */
-
- ! #include <sys/param.h>
- ! #include <ndbm.h>
- ! #include <dirent.h>
- #include <ctype.h>
- #include "cvs.h"
-
- extern char update_dir[];
- --- 14,22 ----
- * of RCS files. Uses the modules database, if necessary.
- */
-
- ! #include <sys/types.h>
- #include <ctype.h>
- + #include "dir.h"
- #include "cvs.h"
-
- extern char update_dir[];
- ***************
- *** 26,32 ****
-
- static char *symtag;
- static char *numtag = ""; /* must be null string, not pointer */
- ! static int delete = 0; /* adding a tag by default */
- static int tag_recursive = 1; /* recursive by default */
-
- tag(argc, argv)
- --- 25,31 ----
-
- static char *symtag;
- static char *numtag = ""; /* must be null string, not pointer */
- ! static int _delete = 0; /* adding a tag by default */
- static int tag_recursive = 1; /* recursive by default */
-
- tag(argc, argv)
- ***************
- *** 56,62 ****
- tag_recursive = 0;
- break;
- case 'd':
- ! delete = 1;
- /* FALL THROUGH */
- case 'f':
- /*
- --- 55,61 ----
- tag_recursive = 0;
- break;
- case 'd':
- ! _delete = 1;
- /* FALL THROUGH */
- case 'f':
- /*
- ***************
- *** 124,133 ****
- } while ((dp = readdir(dirp)) != NULL) {
- if (strcmp(dp->d_name, ".") == 0 ||
- strcmp(dp->d_name, "..") == 0 ||
- ! strcmp(dp->d_name, CVSLCK) == 0)
- continue;
- ! if (strcmp(dp->d_name, CVSATTIC) == 0 &&
- ! !delete && numtag[0] == '\0')
- continue;
- if (isdir(dp->d_name) && tag_recursive) {
- char cwd[MAXPATHLEN];
- --- 123,132 ----
- } while ((dp = readdir(dirp)) != NULL) {
- if (strcmp(dp->d_name, ".") == 0 ||
- strcmp(dp->d_name, "..") == 0 ||
- ! stricmp(dp->d_name, CVSLCK) == 0)
- continue;
- ! if (stricmp(dp->d_name, CVSATTIC) == 0 &&
- ! !_delete && numtag[0] == '\0')
- continue;
- if (isdir(dp->d_name) && tag_recursive) {
- char cwd[MAXPATHLEN];
- ***************
- *** 139,145 ****
- if (update_dir[0] == '\0') {
- (void) strcpy(update_dir, dp->d_name);
- } else {
- ! (void) strcat(update_dir, "/");
- (void) strcat(update_dir, dp->d_name);
- }
- if (!quiet) {
- --- 138,144 ----
- if (update_dir[0] == '\0') {
- (void) strcpy(update_dir, dp->d_name);
- } else {
- ! (void) strcat(update_dir, DIRSEPSTR);
- (void) strcat(update_dir, dp->d_name);
- }
- if (!quiet) {
- ***************
- *** 151,157 ****
- continue;
- }
- err += tagit((char *)0);
- ! if ((cp = rindex(update_dir, '/')) != NULL)
- *cp = '\0';
- else
- update_dir[0] = '\0';
- --- 150,156 ----
- continue;
- }
- err += tagit((char *)0);
- ! if ((cp = rindex_sep(update_dir)) != NULL)
- *cp = '\0';
- else
- update_dir[0] = '\0';
- ***************
- *** 200,206 ****
- }
- #endif
-
- ! if (delete) {
- /*
- * If -d is specified, "force_tag_match" is set, so that this call
- * to Version_Number() will return a NULL version string if
- --- 199,205 ----
- }
- #endif
-
- ! if (_delete) {
- /*
- * If -d is specified, "force_tag_match" is set, so that this call
- * to Version_Number() will return a NULL version string if
- ***************
- *** 220,227 ****
- Version_Number(rcs, symtag, "", version);
- if (version[0] == '\0')
- return (0);
- ! (void) sprintf(prog, "%s/%s -q -N%s %s 2>%s", Rcsbin, RCS,
- ! symtag, rcs, DEVNULL);
- if (system(prog) != 0) {
- warn(0, "failed to remove tag %s for %s", symtag, rcs);
- return (1);
- --- 219,225 ----
- Version_Number(rcs, symtag, "", version);
- if (version[0] == '\0')
- return (0);
- ! (void) sprintf(prog, "%s -q -N%s %s 2>%s", RCS, symtag, rcs, DEVNULL);
- if (system(prog) != 0) {
- warn(0, "failed to remove tag %s for %s", symtag, rcs);
- return (1);
- ***************
- *** 245,252 ****
- */
- (void) strcpy(version, numtag);
- }
- ! (void) sprintf(prog, "%s/%s -q -N%s:%s %s", Rcsbin, RCS, symtag,
- ! version, rcs);
- if (system(prog) != 0) {
- warn(0, "failed to set tag %s to revision %s for %s",
- symtag, version, rcs);
- --- 243,249 ----
- */
- (void) strcpy(version, numtag);
- }
- ! (void) sprintf(prog, "%s -q -N%s:%s %s", RCS, symtag, version, rcs);
- if (system(prog) != 0) {
- warn(0, "failed to set tag %s to revision %s for %s",
- symtag, version, rcs);
- diff -cb orig/update.c src/update.c
- *** orig/update.c Sun Feb 23 15:02:42 1992
- --- src/update.c Sun Feb 23 17:05:50 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: update.c,v 1.27.1.2 91/02/06 18:30:07 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: update.c,v 1.27.1.2 91/02/06 18:30:07 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 50,60 ****
- * automatically created and updated as well.
- */
-
- - #include <sys/param.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- ! #include <sys/wait.h> /* UNOFFICIAL - bug fix */
- ! #include <dirent.h>
- #include "cvs.h"
-
- char update_dir[MAXPATHLEN];
- --- 50,58 ----
- * automatically created and updated as well.
- */
-
- #include <sys/types.h>
- #include <sys/stat.h>
- ! #include "dir.h"
- #include "cvs.h"
-
- char update_dir[MAXPATHLEN];
- ***************
- *** 201,207 ****
- update_Files = 1;
- (void) strcpy(User, cp);
- Locate_RCS();
- ! (void) sprintf(backup, "%s/%s%s", CVSADM, CVSPREFIX, User);
- if (isreadable(User))
- rename_file(User, backup);
- else
- --- 199,205 ----
- update_Files = 1;
- (void) strcpy(User, cp);
- Locate_RCS();
- ! (void) sprintf(backup, "%s%c%s%s", CVSADM, DIRSEP, CVSPREFIX, User);
- if (isreadable(User))
- rename_file(User, backup);
- else
- ***************
- *** 208,217 ****
- (void) unlink(backup);
- if (Tag[0] != '\0' || Date[0] != '\0') {
- Version_Number(Rcs, Tag, Date, VN_Rcs);
- ! (void) sprintf(prog, "%s/%s -q -r%s %s %s", Rcsbin, RCS_CO,
- ! VN_Rcs, Rcs, User);
- } else {
- ! (void) sprintf(prog, "%s/%s -q %s %s", Rcsbin, RCS_CO, Rcs, User);
- }
- if (system(prog) == 0) {
- if (cvswrite == TRUE)
- --- 206,214 ----
- (void) unlink(backup);
- if (Tag[0] != '\0' || Date[0] != '\0') {
- Version_Number(Rcs, Tag, Date, VN_Rcs);
- ! (void) sprintf(prog, "%s -q -r%s %s %s", RCS_CO, VN_Rcs, Rcs, User);
- } else {
- ! (void) sprintf(prog, "%s -q %s %s", RCS_CO, Rcs, User);
- }
- if (system(prog) == 0) {
- if (cvswrite == TRUE)
- ***************
- *** 220,226 ****
- Register(User, VN_Rcs, TS_User);
- if (!really_quiet) {
- if (update_dir[0])
- ! printf("U %s/%s\n", update_dir, User);
- else
- printf("U %s\n", User);
- }
- --- 217,223 ----
- Register(User, VN_Rcs, TS_User);
- if (!really_quiet) {
- if (update_dir[0])
- ! printf("U %s%c%s\n", update_dir, DIRSEP, User);
- else
- printf("U %s\n", User);
- }
- ***************
- *** 240,246 ****
- (void) strcpy(User, cp);
- if (!really_quiet) {
- if (update_dir[0])
- ! printf("M %s/%s\n", update_dir, User);
- else
- printf("M %s\n", User);
- }
- --- 237,243 ----
- (void) strcpy(User, cp);
- if (!really_quiet) {
- if (update_dir[0])
- ! printf("M %s%c%s\n", update_dir, DIRSEP, User);
- else
- printf("M %s\n", User);
- }
- ***************
- *** 257,263 ****
- (void) strcpy(User, cp);
- if (!really_quiet) {
- if (update_dir[0])
- ! printf("A %s/%s\n", update_dir, User);
- else
- printf("A %s\n", User);
- }
- --- 254,260 ----
- (void) strcpy(User, cp);
- if (!really_quiet) {
- if (update_dir[0])
- ! printf("A %s%c%s\n", update_dir, DIRSEP, User);
- else
- printf("A %s\n", User);
- }
- ***************
- *** 270,276 ****
- (void) strcpy(User, cp);
- if (!really_quiet) {
- if (update_dir[0])
- ! printf("R %s/%s\n", update_dir, User);
- else
- printf("R %s\n", User);
- }
- --- 267,273 ----
- (void) strcpy(User, cp);
- if (!really_quiet) {
- if (update_dir[0])
- ! printf("R %s%c%s\n", update_dir, DIRSEP, User);
- else
- printf("R %s\n", User);
- }
- ***************
- *** 293,300 ****
- (void) unlink(backup);
- copy_file(User, backup);
- xchmod(User, 1);
- ! (void) sprintf(prog, "%s/%s -r%s %s", Rcsbin, RCS_MERGE,
- ! VN_User, Rcs);
- /* UNOFFICIAL CHANGE - original code commented out
- if (system(prog) != 0) {
- */
- --- 290,296 ----
- (void) unlink(backup);
- copy_file(User, backup);
- xchmod(User, 1);
- ! (void) sprintf(prog, "%s -r%s %s", RCS_MERGE, VN_User, Rcs);
- /* UNOFFICIAL CHANGE - original code commented out
- if (system(prog) != 0) {
- */
- ***************
- *** 324,330 ****
- warn(0, "conflicts found in %s", User);
- if (!really_quiet) {
- if (update_dir[0])
- ! printf("C %s/%s\n", update_dir, User);
- else
- printf("C %s\n", User);
- }
- --- 320,326 ----
- warn(0, "conflicts found in %s", User);
- if (!really_quiet) {
- if (update_dir[0])
- ! printf("C %s%c%s\n", update_dir, DIRSEP, User);
- else
- printf("C %s\n", User);
- }
- ***************
- *** 331,337 ****
- } else {
- if (!really_quiet) {
- if (update_dir[0])
- ! printf("M %s/%s\n", update_dir, User);
- else
- printf("M %s\n", User);
- }
- --- 327,333 ----
- } else {
- if (!really_quiet) {
- if (update_dir[0])
- ! printf("M %s%c%s\n", update_dir, DIRSEP, User);
- else
- printf("M %s\n", User);
- }
- ***************
- *** 379,389 ****
- } else while ((dp = readdir(dirp)) != NULL) {
- if (strcmp(dp->d_name, ".") == 0 ||
- strcmp(dp->d_name, "..") == 0 ||
- ! strcmp(dp->d_name, CVSATTIC) == 0 ||
- ! strcmp(dp->d_name, CVSLCK) == 0)
- continue;
- ! (void) sprintf(fname, "%s/%s", Repository, dp->d_name);
- ! (void) sprintf(tmp, "%s/%s", dp->d_name, CVSADM);
- if (!isdir(fname))
- continue;
- if (islink(dp->d_name) || isdir(tmp))
- --- 375,385 ----
- } else while ((dp = readdir(dirp)) != NULL) {
- if (strcmp(dp->d_name, ".") == 0 ||
- strcmp(dp->d_name, "..") == 0 ||
- ! stricmp(dp->d_name, CVSATTIC) == 0 ||
- ! stricmp(dp->d_name, CVSLCK) == 0)
- continue;
- ! (void) sprintf(fname, "%s%c%s", Repository, DIRSEP, dp->d_name);
- ! (void) sprintf(tmp, "%s%c%s", dp->d_name, DIRSEP, CVSADM);
- if (!isdir(fname))
- continue;
- if (islink(dp->d_name) || isdir(tmp))
- ***************
- *** 454,460 ****
- char *cp;
- int err;
-
- ! (void) sprintf(fname, "%s/%s", dir, CVSADM);
- if (!isdir(dir) || islink(dir) || !isdir(fname))
- return (0);
- if (getwd(cwd) == NULL) {
- --- 450,456 ----
- char *cp;
- int err;
-
- ! (void) sprintf(fname, "%s%c%s", dir, DIRSEP, CVSADM);
- if (!isdir(dir) || islink(dir) || !isdir(fname))
- return (0);
- if (getwd(cwd) == NULL) {
- ***************
- *** 464,470 ****
- if (update_dir[0] == '\0')
- (void) strcpy(update_dir, dir);
- else {
- ! (void) strcat(update_dir, "/");
- (void) strcat(update_dir, dir);
- }
- if (!quiet)
- --- 460,466 ----
- if (update_dir[0] == '\0')
- (void) strcpy(update_dir, dir);
- else {
- ! (void) strcat(update_dir, DIRSEPSTR);
- (void) strcat(update_dir, dir);
- }
- if (!quiet)
- ***************
- *** 475,481 ****
- goto out;
- }
- err = update(0, (char **)0);
- ! if ((cp = rindex(update_dir, '/')) != NULL)
- *cp = '\0';
- else
- update_dir[0] = '\0';
- --- 471,477 ----
- goto out;
- }
- err = update(0, (char **)0);
- ! if ((cp = rindex_sep(update_dir)) != NULL)
- *cp = '\0';
- else
- update_dir[0] = '\0';
- ***************
- *** 505,511 ****
- }
- while ((dp = readdir(dirp)) != NULL) {
- if (strcmp(dp->d_name, ".") != 0 && strcmp(dp->d_name, "..") != 0 &&
- ! strcmp(dp->d_name, CVSADM) != 0) {
- (void) closedir(dirp);
- return (0);
- }
- --- 501,507 ----
- }
- while ((dp = readdir(dirp)) != NULL) {
- if (strcmp(dp->d_name, ".") != 0 && strcmp(dp->d_name, "..") != 0 &&
- ! stricmp(dp->d_name, CVSADM) != 0) {
- (void) closedir(dirp);
- return (0);
- }
- diff -cb orig/version_number.c src/version_number.c
- *** orig/version_number.c Sun Feb 23 15:02:42 1992
- --- src/version_number.c Sun Jan 19 22:05:04 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: version_number.c,v 1.16.1.2 91/01/29 07:20:26 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: version_number.c,v 1.16.1.2 91/01/29 07:20:26 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 40,46 ****
- * is already nulled.
- */
- if ((fpin = fopen(rcs, "r")) == NULL)
- ! return;
- get_version(fpin, tag, date, rev, vers);
- if (vers[0] == '\0' && tag[0] != '\0') {
- if (!isdigit(tag[0])) {
- --- 40,46 ----
- * is already nulled.
- */
- if ((fpin = fopen(rcs, "r")) == NULL)
- ! return 0;
- get_version(fpin, tag, date, rev, vers);
- if (vers[0] == '\0' && tag[0] != '\0') {
- if (!isdigit(tag[0])) {
- ***************
- *** 51,58 ****
- strncmp(rcs, CVSroot, strlen(CVSroot)) == 0) {
- cp = rcs + strlen(CVSroot) + 1;
- } else {
- ! if ((cp = index(rcs, '/')) == NULL && update_dir[0] != '\0') {
- ! (void) sprintf(temp, "%s/%s", update_dir, rcs);
- cp = temp;
- } else {
- cp = rcs;
- --- 51,58 ----
- strncmp(rcs, CVSroot, strlen(CVSroot)) == 0) {
- cp = rcs + strlen(CVSroot) + 1;
- } else {
- ! if ((cp = index_sep(rcs)) == NULL && update_dir[0] != '\0') {
- ! (void) sprintf(temp, "%s%c%s", update_dir, DIRSEP, rcs);
- cp = temp;
- } else {
- cp = rcs;
- ***************
- *** 99,113 ****
- * Assumption here is that the "head" line is always first.
- */
- if (fgets(line, sizeof(line), fp) == NULL)
- ! return;
- if (strncmp(line, RCSHEAD, sizeof(RCSHEAD) - 1) != 0 ||
- !isspace(line[sizeof(RCSHEAD) - 1]) ||
- (cp = rindex(line, ';')) == NULL)
- ! return;
- *cp = '\0'; /* strip the ';' */
- if ((cp = rindex(line, ' ')) == NULL &&
- (cp = rindex(line, '\t')) == NULL)
- ! return;
- cp++;
- (void) strcpy(rev, cp);
- /*
- --- 99,113 ----
- * Assumption here is that the "head" line is always first.
- */
- if (fgets(line, sizeof(line), fp) == NULL)
- ! return 0;
- if (strncmp(line, RCSHEAD, sizeof(RCSHEAD) - 1) != 0 ||
- !isspace(line[sizeof(RCSHEAD) - 1]) ||
- (cp = rindex(line, ';')) == NULL)
- ! return 0;
- *cp = '\0'; /* strip the ';' */
- if ((cp = rindex(line, ' ')) == NULL &&
- (cp = rindex(line, '\t')) == NULL)
- ! return 0;
- cp++;
- (void) strcpy(rev, cp);
- /*
- ***************
- *** 119,125 ****
- * it is an old format RCS file, and blow it off.
- */
- if (fgets(line, sizeof(line), fp) == NULL)
- ! return;
- if (strncmp(line, RCSBRANCH, sizeof(RCSBRANCH) - 1) == 0 &&
- isspace(line[sizeof(RCSBRANCH) - 1]) &&
- (cp = rindex(line, ';')) != NULL) {
- --- 119,125 ----
- * it is an old format RCS file, and blow it off.
- */
- if (fgets(line, sizeof(line), fp) == NULL)
- ! return 0;
- if (strncmp(line, RCSBRANCH, sizeof(RCSBRANCH) - 1) == 0 &&
- isspace(line[sizeof(RCSBRANCH) - 1]) &&
- (cp = rindex(line, ';')) != NULL) {
- ***************
- *** 126,134 ****
- *cp = '\0'; /* strip the ';' */
- if ((cp = rindex(line, ' ')) == NULL &&
- (cp = rindex(line, '\t')) == NULL)
- ! return;
- cp++;
- ! if (*cp != NULL)
- (void) strcpy(rev, cp);
- }
- /*
- --- 126,134 ----
- *cp = '\0'; /* strip the ';' */
- if ((cp = rindex(line, ' ')) == NULL &&
- (cp = rindex(line, '\t')) == NULL)
- ! return 0;
- cp++;
- ! if (*cp != 0)
- (void) strcpy(rev, cp);
- }
- /*
- ***************
- *** 139,150 ****
- */
- if (date[0] != '\0') {
- get_date(fp, date, rev, vers);
- ! return;
- }
- if (tag[0] != '\0') {
- /* return of 0 means we found an exact match, or there was an error */
- if ((symtag_matched = get_tag(fp, tag, rev, vers)) == 0)
- ! return;
- }
- /*
- * "rev" now contains either the "head" value, or the tag value,
- --- 139,150 ----
- */
- if (date[0] != '\0') {
- get_date(fp, date, rev, vers);
- ! return 0;
- }
- if (tag[0] != '\0') {
- /* return of 0 means we found an exact match, or there was an error */
- if ((symtag_matched = get_tag(fp, tag, rev, vers)) == 0)
- ! return 0;
- }
- /*
- * "rev" now contains either the "head" value, or the tag value,
- ***************
- *** 271,282 ****
- int len, dots = numdots(rev);
-
- if ((dots & 1) != 0)
- ! return;
- (void) sprintf(branch, "%s.", rev);
- len = strlen(branch);
- while (fgets(line, sizeof(line), fp) != NULL) {
- if (strncmp(line, RCSDESC, sizeof(RCSDESC) - 1) == 0)
- ! return;
- if (isdigit(line[0])) {
- if ((cp = rindex(line, '\n')) != NULL)
- *cp = '\0'; /* strip the newline */
- --- 271,282 ----
- int len, dots = numdots(rev);
-
- if ((dots & 1) != 0)
- ! return 0;
- (void) sprintf(branch, "%s.", rev);
- len = strlen(branch);
- while (fgets(line, sizeof(line), fp) != NULL) {
- if (strncmp(line, RCSDESC, sizeof(RCSDESC) - 1) == 0)
- ! return 0;
- if (isdigit(line[0])) {
- if ((cp = rindex(line, '\n')) != NULL)
- *cp = '\0'; /* strip the newline */
- ***************
- *** 348,354 ****
- date_dots = numdots(rev);
- while (fgets(line, sizeof(line), fp) != NULL) {
- if (strncmp(line, RCSDESC, sizeof(RCSDESC) - 1) == 0)
- ! return;
- if (isdigit(line[0])) {
- if ((cp = rindex(line, '\n')) != NULL)
- *cp = '\0'; /* strip the newline */
- --- 348,354 ----
- date_dots = numdots(rev);
- while (fgets(line, sizeof(line), fp) != NULL) {
- if (strncmp(line, RCSDESC, sizeof(RCSDESC) - 1) == 0)
- ! return 0;
- if (isdigit(line[0])) {
- if ((cp = rindex(line, '\n')) != NULL)
- *cp = '\0'; /* strip the newline */
- diff -cb orig/version_ts.c src/version_ts.c
- *** orig/version_ts.c Sun Feb 23 15:02:42 1992
- --- src/version_ts.c Sun Jan 19 15:35:44 1992
- ***************
- *** 1,6 ****
- #ifndef lint
- static char rcsid[] = "$Id: version_ts.c,v 1.8 89/11/20 09:51:12 berliner Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- static char rcsid[] = "$Id: version_ts.c,v 1.8 89/11/20 09:51:12 berliner Exp $";
- ! #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 32,40 ****
- #include <sys/timeb.h>
- #include <sys/stat.h>
- #include <ctype.h>
- - #include <grp.h>
- - #include <pwd.h>
- - #include <utmp.h>
- #include "cvs.h"
-
- /*
- --- 32,37 ----
- ***************
- *** 93,105 ****
- /* Some UNIX distributions don't include these in their stat.h */
- #ifndef S_IWRITE
- #define S_IWRITE 0000200 /* write permission, owner */
- ! #endif !S_IWRITE
- #ifndef S_IWGRP
- #define S_IWGRP 0000020 /* write permission, grougroup */
- ! #endif !S_IWGRP
- #ifndef S_IWOTH
- #define S_IWOTH 0000002 /* write permission, other */
- ! #endif !S_IWOTH
-
- /*
- * Gets the time-stamp for the file "file" and puts it in the already
- --- 90,102 ----
- /* Some UNIX distributions don't include these in their stat.h */
- #ifndef S_IWRITE
- #define S_IWRITE 0000200 /* write permission, owner */
- ! #endif
- #ifndef S_IWGRP
- #define S_IWGRP 0000020 /* write permission, grougroup */
- ! #endif
- #ifndef S_IWOTH
- #define S_IWOTH 0000002 /* write permission, other */
- ! #endif
-
- /*
- * Gets the time-stamp for the file "file" and puts it in the already
-