summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkrapht <krapht@cvs.openbsd.org>2004-11-09 21:11:38 +0000
committerkrapht <krapht@cvs.openbsd.org>2004-11-09 21:11:38 +0000
commit4b529c03ed57ba0fb9c5c81366b094540a258d7c (patch)
tree310a4ee5357522de3c7242ea9528bb065ccddcc3
parent6887e709276efa203fadc020f330da9e395e729f (diff)
at least compile
-rw-r--r--usr.bin/cvs/commit.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c
index 88f03c4b755..569b54e71b2 100644
--- a/usr.bin/cvs/commit.c
+++ b/usr.bin/cvs/commit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: commit.c,v 1.3 2004/11/09 20:59:31 krapht Exp $ */
+/* $OpenBSD: commit.c,v 1.4 2004/11/09 21:11:37 krapht Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -148,15 +148,18 @@ cvs_commit_openmsg(const char *path)
}
sz = strlen(buf);
- if ((sz == 0) || (sz > 2)) {
+ if ((sz == 0) || (sz > 2) ||
+ ((buf[sz] != 'y') && (buf[sz] != 'n'))) {
+ fprintf(stderr, "invalid input\n");
continue;
}
-
+ else if (buf[sz] == 'y')
+ break;
+ else if (buf[sz] == 'n') {
cvs_log(LP_ERR, "aborted by user");
return (NULL);
}
- fprintf(stderr, "Invalid character\n");
} while (1);
}