From fdcaeeb8a32ca664530ddfef5db66722ca9ed6d0 Mon Sep 17 00:00:00 2001 From: Thorsten Lockert Date: Fri, 18 Oct 1996 17:44:29 +0000 Subject: Undo CVSroot change in main.c Pass CVS root directory as an argument to parseopts() Add prototype for parseopts() --- gnu/usr.bin/cvs/src/cvs.h | 1 + gnu/usr.bin/cvs/src/main.c | 13 +++++++------ gnu/usr.bin/cvs/src/server.c | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'gnu/usr.bin/cvs') diff --git a/gnu/usr.bin/cvs/src/cvs.h b/gnu/usr.bin/cvs/src/cvs.h index c8dbe22f869..dd96dd063a3 100644 --- a/gnu/usr.bin/cvs/src/cvs.h +++ b/gnu/usr.bin/cvs/src/cvs.h @@ -425,6 +425,7 @@ int isabsolute PROTO((const char *filename)); char *last_component PROTO((char *path)); char *get_homedir PROTO ((void)); char *cvs_temp_name PROTO ((void)); +void parseopts PROTO ((const char *root)); int numdots PROTO((const char *s)); int unlink_file PROTO((const char *f)); diff --git a/gnu/usr.bin/cvs/src/main.c b/gnu/usr.bin/cvs/src/main.c index 0e4e48639fb..86ac0c7b0ee 100644 --- a/gnu/usr.bin/cvs/src/main.c +++ b/gnu/usr.bin/cvs/src/main.c @@ -46,8 +46,6 @@ mode_t cvsumask = UMASK_DFLT; char *CurDir; -static char *CVSroot = CVSROOT_DFLT; - /* * Defaults, for the environment variables that are not set */ @@ -304,6 +302,7 @@ main (argc, argv) int argc; char **argv; { + char *CVSroot = CVSROOT_DFLT; extern char *version_string; extern char *config_string; char *cp, *end; @@ -913,7 +912,9 @@ usage (cpp) exit (EXIT_FAILURE); } -parseopts() +void +parseopts(root) + const char *root; { char path[PATH_MAX]; int save_errno; @@ -921,15 +922,15 @@ parseopts() char *p; FILE *fp; - if (CVSroot == NULL) { + if (root == NULL) { printf("no CVSROOT in parseopts\n"); return; } - p = strchr (CVSroot, ':'); + p = strchr (root, ':'); if (p) p++; else - p = CVSroot; + p = root; if (p == NULL) { printf("mangled CVSROOT in parseopts\n"); return; diff --git a/gnu/usr.bin/cvs/src/server.c b/gnu/usr.bin/cvs/src/server.c index 35f73d90951..20f973b2058 100644 --- a/gnu/usr.bin/cvs/src/server.c +++ b/gnu/usr.bin/cvs/src/server.c @@ -501,7 +501,7 @@ Sorry, you don't have read/write access to the history file %s", path); (void) putenv (env); /* do not free env, as putenv has control of it */ #endif - parseopts(); + parseopts(CVSroot_directory); } /* -- cgit v1.2.3