commit 76e8179b214bea8c00515956c1602522caa759b6 parent 97989d0dba5a1616b7ddd0ef5509174970c4e80a Author: sin <sin@2f30.org> Date: Fri, 16 May 2014 15:22:15 +0100 Fix handling of quotes - no multiple arguments Diffstat:
M | parser.c | | | 13 | ++++++++----- |
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/parser.c b/parser.c @@ -383,11 +383,14 @@ evalok(struct object *o) static struct object * evalquote(struct object *o) { - if (o->type == OPair) - if (car(o)->type == OIdentifier && - strcmp(car(o)->d.i.name, "quote") == 0) - return cadr(o); - return NULL; + if (o->type != OPair) + return NULL; + if (car(o)->type != OIdentifier || + strcmp(car(o)->d.i.name, "quote") != 0) + return NULL; + if (caddr(o)) + return error("multiple arguments"); + return cadr(o); } static struct object *