From fa7d59804e98cc73f0ab3ed96166889f1767d4db Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Sun, 15 Jun 2008 16:50:35 +0100 Subject: [PATCH] Correct sense of parse_rights(). Organization: Straylight/Edgeware From: Richard Kettlewell --- lib/eclient.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/eclient.c b/lib/eclient.c index ad34a21..48ae7e2 100644 --- a/lib/eclient.c +++ b/lib/eclient.c @@ -1449,12 +1449,18 @@ static void logline(disorder_eclient *c, const char *line) { return; } /* TODO: do something with the time */ + //fprintf(stderr, "log key: %s\n", vec[1]); n = TABLE_FIND(logentry_handlers, name, vec[1]); - if(n < 0) return; /* probably a future command */ + if(n < 0) { + //fprintf(stderr, "...not found\n"); + return; /* probably a future command */ + } vec += 2; nvec -= 2; - if(nvec < logentry_handlers[n].min || nvec > logentry_handlers[n].max) + if(nvec < logentry_handlers[n].min || nvec > logentry_handlers[n].max) { + //fprintf(stderr, "...wrong # args\n"); return; + } logentry_handlers[n].handler(c, nvec, vec); } @@ -1569,7 +1575,7 @@ static void logentry_rights_changed(disorder_eclient *c, int attribute((unused)) nvec, char **vec) { if(c->log_callbacks->rights_changed) { rights_type r; - if(parse_rights(vec[0], &r, 0/*report*/)) + if(!parse_rights(vec[0], &r, 0/*report*/)) c->log_callbacks->rights_changed(c->log_v, r); } } -- [mdw]