[augeas-devel] augeas: master - * src/syntax.c (compile): give up after the first error
David Lutterkort
lutter at fedoraproject.org
Thu Jan 14 22:58:10 UTC 2010
Gitweb: http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=566cd261b9e5f08b919d916b809082bdc59e8a0e
Commit: 566cd261b9e5f08b919d916b809082bdc59e8a0e
Parent: df30e4e6c42c09d3178fe1b7f488f97bb5249f38
Author: David Lutterkort <lutter at redhat.com>
AuthorDate: Thu Jan 14 11:54:22 2010 -0800
Committer: David Lutterkort <lutter at redhat.com>
CommitterDate: Thu Jan 14 12:04:36 2010 -0800
* src/syntax.c (compile): give up after the first error
We have no error recovery to speak off; if we keep going, we most of the
time carpet-bomb the user with error messages that are simple follow-ons to
the first error.
---
src/syntax.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/syntax.c b/src/syntax.c
index 6918376..9f3e2a2 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1758,17 +1758,15 @@ static int compile_decl(struct term *term, struct ctx *ctx) {
static struct module *compile(struct term *term, struct augeas *aug) {
struct ctx ctx;
struct transform *autoload = NULL;
- int ok = 1;
assert(term->tag == A_MODULE);
ctx.aug = aug;
ctx.local = NULL;
ctx.name = term->mname;
list_for_each(dcl, term->decls) {
- ok &= compile_decl(dcl, &ctx);
+ if (!compile_decl(dcl, &ctx))
+ goto error;
}
- if (!ok)
- goto error;
if (term->autoload != NULL) {
struct binding *bnd = bnd_lookup(ctx.local, term->autoload);
More information about the augeas-devel
mailing list