X-Git-Url: http://git.pk910.de/?p=iauth.git;a=blobdiff_plain;f=iauth_query.c;h=d0026ff44be38efd9d85b958040d171f6a23fff4;hp=7c7c7145bc0e54c131e283dc16c77cf81b0b23a3;hb=6c5d28e7d64367ce02b2004513a1c35a77c0814a;hpb=6676849549767afb5fdcd602760c3217981d67c6 diff --git a/iauth_query.c b/iauth_query.c index 7c7c714..d0026ff 100644 --- a/iauth_query.c +++ b/iauth_query.c @@ -113,6 +113,18 @@ const struct iauth_result *iauth_query(struct iauth_client *cli) { return NULL; } *arg++ = 0; + if(strcmp(tread, "error") == 0) { + strcpy(res.cclass, "error"); + tread = arg; + if(!(arg = strchr(tread, '%'))) { + close(fds[0]); + return NULL; + } + *arg++ = 0; + + strcpy(res.str, tread); + return &res; + } if(strcmp(tread, "$") == 0 || strlen(tread) > IAUTH_DATALEN) res.cclass[0] = 0; else strcpy(res.cclass, tread); @@ -148,10 +160,11 @@ const struct iauth_result *iauth_query(struct iauth_client *cli) { /* Read modes string. */ tread = arg; - if(!*tread) { + if(!(arg = strchr(tread, '%'))) { close(fds[0]); return NULL; } + *arg++ = 0; if(strcmp(tread, "$") == 0 || strlen(tread) > IAUTH_DATALEN) res.modes[0] = 0; else strcpy(res.modes, tread);