summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2005-05-03 08:55:17 +0000
committerJoris Vink <joris@cvs.openbsd.org>2005-05-03 08:55:17 +0000
commit82eaae8218660eb2c07bc5b68c91e7bb06f85a1f (patch)
tree1aa6348754227c3127bf69e27e176b380cb8ac0d
parent39fdadcf4c611694ff7e318c190b21be7431b07b (diff)
catch stupid gnu cvs behaviour, it sends an empty error message
at the end of a diff command (even successfull ones) so we have to make sure not to show the empty line on screen. ok xsa@
-rw-r--r--usr.bin/cvs/resp.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.bin/cvs/resp.c b/usr.bin/cvs/resp.c
index 22731f8e30f..59200b0432a 100644
--- a/usr.bin/cvs/resp.c
+++ b/usr.bin/cvs/resp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: resp.c,v 1.30 2005/04/20 15:50:54 joris Exp $ */
+/* $OpenBSD: resp.c,v 1.31 2005/05/03 08:55:16 joris Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -302,11 +302,19 @@ cvs_resp_ok(struct cvsroot *root, int type, char *line)
* cvs_resp_error()
*
* Handler for the `error' response. This handler's job is to
+ * show the error message given by the server.
*/
static int
cvs_resp_error(struct cvsroot *root, int type, char *line)
{
+ /* XXX - GNU cvs sends an empty error message
+ * at the end of the diff command, even for successfull
+ * diff.
+ */
+ if ((strlen(line) == 1) && (*line == ' '))
+ return (1);
+
fprintf(stderr, "%s\n", line);
return (1);
}