diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2006-12-19 14:11:22 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2006-12-19 14:11:22 +0000 |
commit | 3fbfd4061e674669c05243d47974d754b0bdfec9 (patch) | |
tree | 9a9a21376640fbecf6c701241a0addba07b823a4 /usr.bin/cvs/client.c | |
parent | 7f29cd36065471fc0ec53fb8bb5ccda172b2797a (diff) |
add client-side support for Set-static-directory.
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; |