From 4b529c03ed57ba0fb9c5c81366b094540a258d7c Mon Sep 17 00:00:00 2001 From: krapht Date: Tue, 9 Nov 2004 21:11:38 +0000 Subject: at least compile --- usr.bin/cvs/commit.c | 11 +++++++---- 1 file 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 * 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); } -- cgit v1.2.3