diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2008-11-10 02:13:41 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2008-11-10 02:13:41 +0000 |
commit | 4cc54b7acdab8e3e14d2f7a5824345095c1ab501 (patch) | |
tree | 90d42886275b2cd71f3b4731335155574f40acd8 | |
parent | 0ae50b9c7b96da5e34efe34d92f99373dbb774ad (diff) |
- move '=>' into the lex loop, requested by and with help from deraadt@
-rw-r--r-- | usr.sbin/smtpd/parse.y | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/usr.sbin/smtpd/parse.y b/usr.sbin/smtpd/parse.y index 670f305bc1a..3e50fde4e00 100644 --- a/usr.sbin/smtpd/parse.y +++ b/usr.sbin/smtpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.5 2008/11/10 00:57:35 gilles Exp $ */ +/* $OpenBSD: parse.y,v 1.6 2008/11/10 02:13:40 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -113,7 +113,7 @@ typedef struct { %token DNS DB TFILE EXTERNAL DOMAIN CONFIG SOURCE %token RELAY VIA DELIVER TO MAILDIR MBOX HOSTNAME %token ACCEPT REJECT INCLUDE NETWORK ERROR MDA FROM FOR -%token KVSEP +%token ARROW %token <v.string> STRING %token <v.number> NUMBER %type <v.map> map @@ -347,7 +347,7 @@ map : MAP STRING { } ; -keyval : STRING KVSEP STRING { +keyval : STRING ARROW STRING { struct mapel *me; if ((me = calloc(1, sizeof(*me))) == NULL) @@ -766,7 +766,6 @@ lookup(char *s) { /* this has to be sorted always */ static const struct keywords keywords[] = { - { "=>", KVSEP }, { "accept", ACCEPT }, { "all", ALL }, { "certificate", CERTIFICATE }, @@ -1022,6 +1021,13 @@ nodigits: } } + if (c == '=') { + if ((c = lgetc(0)) != EOF && c == '>') + return (ARROW); + lungetc(c); + c = '='; + } + #define allowed_in_string(x) \ (isalnum(x) || (ispunct(x) && x != '(' && x != ')' && \ x != '{' && x != '}' && x != '<' && x != '>' && \ |