aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_argv.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-05-30 16:22:03 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-05-30 16:22:03 +0000
commita20be95dec7797c55257792a32b6b39bdbdfe595 (patch)
treec792fc779fd4c6076766e78fa7644b081e72b26f /mdoc_argv.c
parenta81d5d8c62b37fdb8d82d9cebd9cfa044222b9d8 (diff)
downloadmandoc-a20be95dec7797c55257792a32b6b39bdbdfe595.tar.gz
mandoc-a20be95dec7797c55257792a32b6b39bdbdfe595.tar.zst
mandoc-a20be95dec7797c55257792a32b6b39bdbdfe595.zip
Macro argument quoting does not prevent recognition of punctuation
and of called macros. This bug affects almost all macros, and fixing it simplifies the code. It is amazing that the bogus ARGS_QWORD feature got implemented in the first place, and then carrier along for more than eight years without anybody ever noticing that it was pointless. Reported by Leah Neukirchen <leah at vuxu dot org>, found on Void Linux.
Diffstat (limited to 'mdoc_argv.c')
-rw-r--r--mdoc_argv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mdoc_argv.c b/mdoc_argv.c
index 8689ab86..db4c63f0 100644
--- a/mdoc_argv.c
+++ b/mdoc_argv.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_argv.c,v 1.114 2017/05/05 15:17:32 schwarze Exp $ */
+/* $Id: mdoc_argv.c,v 1.115 2017/05/30 16:22:03 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2012, 2014-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -555,14 +555,14 @@ args(struct roff_man *mdoc, int line, int *pos,
if ( ! (mdoc->flags & MDOC_PHRASE))
mandoc_msg(MANDOCERR_ARG_QUOTE,
mdoc->parse, line, *pos, NULL);
- return ARGS_QWORD;
+ return ARGS_WORD;
}
mdoc->flags &= ~MDOC_PHRASELIT;
buf[(*pos)++] = '\0';
if ('\0' == buf[*pos])
- return ARGS_QWORD;
+ return ARGS_WORD;
while (' ' == buf[*pos])
(*pos)++;
@@ -571,7 +571,7 @@ args(struct roff_man *mdoc, int line, int *pos,
mandoc_msg(MANDOCERR_SPACE_EOL, mdoc->parse,
line, *pos, NULL);
- return ARGS_QWORD;
+ return ARGS_WORD;
}
p = &buf[*pos];