summaryrefslogtreecommitdiff
path: root/usr.bin/cvs
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2005-06-02 20:16:49 +0000
committerJoris Vink <joris@cvs.openbsd.org>2005-06-02 20:16:49 +0000
commitad5af1e36e90c554824c209077c6d62c2e24645c (patch)
treeb9d5097db357885ea22379502de4355206472193 /usr.bin/cvs
parent809fe387ac6bc6e5658b57d4cf532e1f4b99f72f (diff)
make cvs_printf() a bit smarter, so it can be called without having
to worry about the 'M' in server mode. OK jfb@
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r--usr.bin/cvs/log.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.bin/cvs/log.c b/usr.bin/cvs/log.c
index 82e01b2a84c..c78eb32926e 100644
--- a/usr.bin/cvs/log.c
+++ b/usr.bin/cvs/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.17 2005/06/02 16:05:38 xsa Exp $ */
+/* $OpenBSD: log.c,v 1.18 2005/06/02 20:16:48 joris Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -299,6 +299,7 @@ cvs_printf(const char *fmt, ...)
int ret;
char *nstr, *dp, *sp;
va_list vap;
+ static int send_m = 1;
va_start(vap, fmt);
@@ -311,8 +312,12 @@ cvs_printf(const char *fmt, ...)
for (sp = dp; *sp != '\0'; sp++)
;
- putc('M', stdout);
- putc(' ', stdout);
+ if (send_m) {
+ send_m = 0;
+ putc('M', stdout);
+ putc(' ', stdout);
+ }
+
fwrite(dp, sizeof(char), (size_t)(sp - dp),
stdout);
@@ -320,6 +325,7 @@ cvs_printf(const char *fmt, ...)
break;
putc('\n', stdout);
+ send_m = 1;
dp = sp + 1;
}
free(nstr);