diff options
author | 2006-12-14 15:13:17 +0000 | |
---|---|---|
committer | 2006-12-14 15:13:17 +0000 | |
commit | 4b21b1922707e00fdb7741fd8b6b80412948c3ac (patch) | |
tree | 05918c2b171b6854b308eaea54ee3f0b2a2b2d9a | |
parent | Add defines for several SPARC-V9 implementations. (diff) | |
download | wireguard-openbsd-4b21b1922707e00fdb7741fd8b6b80412948c3ac.tar.xz wireguard-openbsd-4b21b1922707e00fdb7741fd8b6b80412948c3ac.zip |
add support for the "Sticky" request; client-side only for now.
-rw-r--r-- | usr.bin/cvs/client.c | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/usr.bin/cvs/client.c b/usr.bin/cvs/client.c index 3361db965ab..a72ce40c1ef 100644 --- a/usr.bin/cvs/client.c +++ b/usr.bin/cvs/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.28 2006/11/27 16:19:59 xsa Exp $ */ +/* $OpenBSD: client.c,v 1.29 2006/12/14 15:13:17 xsa Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -386,7 +386,10 @@ cvs_client_get_responses(void) void cvs_client_senddir(const char *dir) { - char *repo; + int nb; + char *d, *date, *repo, *tag; + + d = NULL; if (lastdir != NULL && !strcmp(dir, lastdir)) return; @@ -398,6 +401,36 @@ cvs_client_senddir(const char *dir) cvs_remote_output(repo); xfree(repo); + d = xstrdup(dir); + cvs_parse_tagfile(d, &tag, &date, &nb); + + if (tag != NULL || date != NULL) { + char buf[128]; + + if (tag != NULL && nb != NULL) { + if (strlcpy(buf, "N", sizeof(buf)) >= sizeof(buf)) + fatal("cvs_client_senddir: truncation"); + } else if (tag != NULL) { + if (strlcpy(buf, "T", sizeof(buf)) >= sizeof(buf)) + fatal("cvs_client_senddir: truncation"); + } else { + if (strlcpy(buf, "D", sizeof(buf)) >= sizeof(buf)) + fatal("cvs_client_senddir: truncation"); + } + + if (strlcat(buf, tag ? tag : date, sizeof(buf)) >= sizeof(buf)) + fatal("cvs_client_senddir: truncation"); + + cvs_client_send_request("Sticky %s", buf); + + if (tag != NULL) + xfree(tag); + if (date != NULL) + xfree(date); + } + if (d != NULL) + xfree(d); + if (lastdir != NULL) xfree(lastdir); lastdir = xstrdup(dir); |