diff options
author | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2008-08-29 09:46:11 +0000 |
---|---|---|
committer | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2008-08-29 09:46:11 +0000 |
commit | 08621619f49db13c940f47054af472d467682f89 (patch) | |
tree | 94210a7e2cc83d43f296a37c8eb3e69679ab573a /usr.bin/cvs/trigger.c | |
parent | 92b2e0767822740158884d6d0f6b7f6b69ccb0f4 (diff) |
If parsing of a command in one of the trigger files fails, treat this as an
error instead of ignoring it.
ok joris
Diffstat (limited to 'usr.bin/cvs/trigger.c')
-rw-r--r-- | usr.bin/cvs/trigger.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/usr.bin/cvs/trigger.c b/usr.bin/cvs/trigger.c index f3c86c5bb53..454dd781b2e 100644 --- a/usr.bin/cvs/trigger.c +++ b/usr.bin/cvs/trigger.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trigger.c,v 1.14 2008/06/17 17:15:56 tobias Exp $ */ +/* $OpenBSD: trigger.c,v 1.15 2008/08/29 09:46:10 tobias Exp $ */ /* * Copyright (c) 2008 Tobias Stoeckmann <tobias@openbsd.org> * Copyright (c) 2008 Jonathan Armani <dbd@asystant.net> @@ -288,26 +288,25 @@ cvs_trigger_handle(int type, char *repo, char *in, struct trigger_list *list, struct trigger_line *line; TAILQ_FOREACH(line, list, flist) { - cmd = parse_cmd(type, line->line, repo, files); - if (cmd != NULL) { - switch(type) { - case CVS_TRIGGER_COMMITINFO: - case CVS_TRIGGER_TAGINFO: - case CVS_TRIGGER_VERIFYMSG: - if ((r = cvs_exec(cmd, NULL, 1)) != 0) { - xfree(cmd); - return r; - } - break; - default: - (void)cvs_exec(cmd, in, 1); - break; + if ((cmd = parse_cmd(type, line->line, repo, files)) == NULL) + return (1); + switch(type) { + case CVS_TRIGGER_COMMITINFO: + case CVS_TRIGGER_TAGINFO: + case CVS_TRIGGER_VERIFYMSG: + if ((r = cvs_exec(cmd, NULL, 1)) != 0) { + xfree(cmd); + return (r); } - xfree(cmd); + break; + default: + (void)cvs_exec(cmd, in, 1); + break; } + xfree(cmd); } - return 0; + return (0); } struct trigger_list * |