diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-10-12 20:08:44 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-10-12 20:08:44 +0000 |
commit | ee0d385cb596349a17f8188217b82cbcd2cd73cd (patch) | |
tree | cc9a0cfcebf75c6b88aea36db53d4cb5583a1730 /usr.bin/mandoc | |
parent | 6b5d3cc8e5dde345ae4626d0064de9051fac466a (diff) |
bugfix: do not parse quoted strings for tokens; fixes glFrustum(3)
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r-- | usr.bin/mandoc/eqn.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.bin/mandoc/eqn.c b/usr.bin/mandoc/eqn.c index 88e1bb0727c..c6a779646c6 100644 --- a/usr.bin/mandoc/eqn.c +++ b/usr.bin/mandoc/eqn.c @@ -1,6 +1,7 @@ -/* $OpenBSD: eqn.c,v 1.15 2014/10/12 19:10:56 schwarze Exp $ */ +/* $OpenBSD: eqn.c,v 1.16 2014/10/12 20:08:43 schwarze Exp $ */ /* * Copyright (c) 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> + * Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -484,13 +485,22 @@ eqn_tok_parse(struct eqn_node *ep, char **p) { const char *start; size_t i, sz; + int quoted; if (NULL != p) *p = NULL; + quoted = ep->data[ep->cur] == '"'; + if (NULL == (start = eqn_nexttok(ep, &sz))) return(EQN_TOK_EOF); + if (quoted) { + if (p != NULL) + *p = mandoc_strndup(start, sz); + return(EQN_TOK__MAX); + } + for (i = 0; i < EQN_TOK__MAX; i++) { if (NULL == eqn_toks[i]) continue; |