summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-10-12 20:08:58 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-10-12 20:08:58 +0000
commit02b3344e0fd21379414fda1db3eb2c2471609106 (patch)
tree50f16dc03d948b21242137c2a6e74ffa9f5e5414
parent3aae5aea6108aec8f9c8d9e61ef797f5291a0c60 (diff)
downloadmandoc-02b3344e0fd21379414fda1db3eb2c2471609106.tar.gz
bugfix: do not parse quoted strings for tokens; fixes glFrustum(3)
-rw-r--r--eqn.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/eqn.c b/eqn.c
index 2977f028..64f2348d 100644
--- a/eqn.c
+++ b/eqn.c
@@ -1,6 +1,7 @@
/* $Id$ */
/*
* 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
@@ -486,13 +487,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;