diff options
Diffstat (limited to 'usr.bin/cvs/client.c')
-rw-r--r-- | usr.bin/cvs/client.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/usr.bin/cvs/client.c b/usr.bin/cvs/client.c index 74d6cf4f3b5..ce5792617bd 100644 --- a/usr.bin/cvs/client.c +++ b/usr.bin/cvs/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.35 2006/12/19 11:46:39 xsa Exp $ */ +/* $OpenBSD: client.c,v 1.36 2006/12/19 14:11:21 xsa Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -741,6 +741,34 @@ cvs_client_remove_entry(char *data) } void +cvs_client_set_static_directory(char *data) +{ + FILE *fp; + char *dir, *fpath; + + if (cvs_cmdop == CVS_OP_EXPORT) + return; + + STRIP_SLASH(data); + + dir = cvs_remote_input(); + xfree(dir); + + fpath = xmalloc(MAXPATHLEN); + if (cvs_path_cat(data, CVS_PATH_STATICENTRIES, fpath, MAXPATHLEN) >= + MAXPATHLEN) + fatal("cvs_client_set_static_directory: truncation"); + + if ((fp = fopen(fpath, "w+")) == NULL) { + cvs_log(LP_ERRNO, "%s", fpath); + goto out; + } + (void)fclose(fp); +out: + xfree(fpath); +} + +void cvs_client_clear_static_directory(char *data) { char *dir, *fpath; |