From 9dc16a5e25ab568213c3e52e142efd6098a14ac8 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Thu, 15 Apr 2004 01:41:05 +0000 Subject: [PATCH] Change WriteTemplate to take const char * args. The Name_Root() call seems to be defunct, remove it because it was causing compile problems. The real magic seems to be in the Parse_Info() callback (which was also updated for const char * args). --- contrib/cvs/src/cvs.h | 2 +- contrib/cvs/src/entries.c | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/contrib/cvs/src/cvs.h b/contrib/cvs/src/cvs.h index 68d46cc3cbe6..f59a9ca0f171 100644 --- a/contrib/cvs/src/cvs.h +++ b/contrib/cvs/src/cvs.h @@ -580,7 +580,7 @@ void ParseTag PROTO((char **tagp, char **datep, int *nonbranchp)); void WriteTag PROTO ((const char *dir, const char *tag, const char *date, int nonbranch, const char *update_dir, const char *repository)); -void WriteTemplate PROTO ((char *dir, char *update_dir)); +void WriteTemplate PROTO ((const char *dir, const char *update_dir)); void cat_module PROTO((int status)); void check_entries PROTO((char *dir)); void close_module PROTO((DBM * db)); diff --git a/contrib/cvs/src/entries.c b/contrib/cvs/src/entries.c index 98cb0068cd9e..1ab7c7e5a5d9 100644 --- a/contrib/cvs/src/entries.c +++ b/contrib/cvs/src/entries.c @@ -641,7 +641,7 @@ AddEntryNode (list, entdata) static char *root_template; static int -get_root_template(char *repository, char *path) +get_root_template(const char *repository, const char *path) { if (root_template) { if (strcmp(path, root_template) == 0) @@ -658,19 +658,16 @@ get_root_template(char *repository, char *path) */ void WriteTemplate (dir, update_dir) - char *dir; - char *update_dir; + const char *dir; + const char *update_dir; { char *tmp = NULL; - char *root = NULL; struct stat st1; struct stat st2; if (Parse_Info(CVSROOTADM_RCSINFO, "cvs", get_root_template, 1) < 0) return; - if ((root = Name_Root(dir, update_dir)) == NULL) - error (1, errno, "unable to locate cvs root"); if (asprintf(&tmp, "%s/%s", dir, CVSADM_TEMPLATE) < 0) error (1, errno, "out of memory"); @@ -705,7 +702,6 @@ WriteTemplate (dir, update_dir) } } free(tmp); - free(root); } /*