summaryrefslogtreecommitdiffstats
path: root/contrib/cvs/src/repos.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2004-04-15 01:01:56 +0000
committerpeter <peter@FreeBSD.org>2004-04-15 01:01:56 +0000
commit3aa249bff61808355fd6b864b94fd531fd00b3b7 (patch)
tree48f5bc180abb032c255cbad668a4838647de32f2 /contrib/cvs/src/repos.c
parentdfd3c578a82a6f926669c53ec72c55f7aba93228 (diff)
parent6045cae71a438a752980a395f03717a13cc22179 (diff)
downloadFreeBSD-src-3aa249bff61808355fd6b864b94fd531fd00b3b7.zip
FreeBSD-src-3aa249bff61808355fd6b864b94fd531fd00b3b7.tar.gz
This commit was generated by cvs2svn to compensate for changes in r128266,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/cvs/src/repos.c')
-rw-r--r--contrib/cvs/src/repos.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/contrib/cvs/src/repos.c b/contrib/cvs/src/repos.c
index 8cdcb45..2c7a3bc 100644
--- a/contrib/cvs/src/repos.c
+++ b/contrib/cvs/src/repos.c
@@ -21,11 +21,11 @@
char *
Name_Repository (dir, update_dir)
- char *dir;
- char *update_dir;
+ const char *dir;
+ const char *update_dir;
{
FILE *fpin;
- char *xupdate_dir;
+ const char *xupdate_dir;
char *repos = NULL;
size_t repos_allocated = 0;
char *tmp;
@@ -123,8 +123,9 @@ Name_Repository (dir, update_dir)
error (0, 0, "`..'-relative repositories are not supported.");
error (1, 0, "illegal source repository");
}
- newrepos = xmalloc (strlen (current_parsed_root->directory) + strlen (repos) + 2);
- (void) sprintf (newrepos, "%s/%s", current_parsed_root->directory, repos);
+ newrepos = xmalloc (strlen (current_parsed_root->directory)
+ + strlen (repos) + 2);
+ sprintf (newrepos, "%s/%s", current_parsed_root->directory, repos);
free (repos);
repos = newrepos;
}
@@ -134,29 +135,33 @@ Name_Repository (dir, update_dir)
return repos;
}
+
+
/*
* Return a pointer to the repository name relative to CVSROOT from a
* possibly fully qualified repository
*/
-char *
+const char *
Short_Repository (repository)
- char *repository;
+ const char *repository;
{
if (repository == NULL)
- return (NULL);
+ return NULL;
/* If repository matches CVSroot at the beginning, strip off CVSroot */
/* And skip leading '/' in rep, in case CVSroot ended with '/'. */
if (strncmp (current_parsed_root->directory, repository,
strlen (current_parsed_root->directory)) == 0)
{
- char *rep = repository + strlen (current_parsed_root->directory);
+ const char *rep = repository + strlen (current_parsed_root->directory);
return (*rep == '/') ? rep+1 : rep;
}
else
- return (repository);
+ return repository;
}
+
+
/* Sanitize the repository name (in place) by removing trailing
* slashes and a trailing "." if present. It should be safe for
* callers to use strcat and friends to create repository names.
@@ -179,12 +184,7 @@ Short_Repository (repository)
* back further someday, so that the trailing "/." doesn't get into
* repository in the first place, but we haven't taken things that
* far yet.'' --Jim Kingdon (recurse.c, 07-Sep-97)
- *
- * Ahh, all too true. The major consideration is RELATIVE_REPOS. If
- * the "/." doesn't end up in the repository while RELATIVE_REPOS is
- * defined, there will be nothing in the CVS/Repository file. I
- * haven't verified that the remote protocol will handle that
- * correctly yet, so I've not made that change. */
+ */
void
Sanitize_Repository_Name (repository)
OpenPOWER on IntegriCloud