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).
This commit is contained in:
parent
091764700c
commit
9dc16a5e25
@ -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));
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user