diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-09-06 22:39:36 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-09-06 22:39:36 +0000 |
commit | 1e75b893a49c0cbdd978438e15c5a8fa8aebb510 (patch) | |
tree | bf90cf9b636235019a1d66752a1e2e08e9d832dd /libmandoc.h | |
parent | a828d911328c6ac46d0f8c2f2d99e9f0bb46e21d (diff) | |
download | mandoc-1e75b893a49c0cbdd978438e15c5a8fa8aebb510.tar.gz mandoc-1e75b893a49c0cbdd978438e15c5a8fa8aebb510.tar.zst mandoc-1e75b893a49c0cbdd978438e15c5a8fa8aebb510.zip |
Move main format autodetection from the parser dispatcher to the
roff parser where .Dd and .TH are already detected, anyway. This
improves robustness because it correctly handles whitespace or an
alternate control character before Dd. In the parser dispatcher,
provide a fallback looking ahead in the input buffer instead of
always assuming man(7). This corrects autodetection when Dd is
preceded by other macros or macro-like handled requests like .ll.
Triggered by reports from Daniel Levai about issues on Slackware Linux.
Diffstat (limited to 'libmandoc.h')
-rw-r--r-- | libmandoc.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libmandoc.h b/libmandoc.h index 1011cc50..6d629db3 100644 --- a/libmandoc.h +++ b/libmandoc.h @@ -1,4 +1,4 @@ -/* $Id: libmandoc.h,v 1.42 2014/07/09 11:31:43 schwarze Exp $ */ +/* $Id: libmandoc.h,v 1.43 2014/09/06 22:39:36 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -77,6 +77,7 @@ int roff_getreg(const struct roff *, const char *); char *roff_strdup(const struct roff *, const char *); int roff_getcontrol(const struct roff *, const char *, int *); +int roff_getformat(const struct roff *); #if 0 char roff_eqndelim(const struct roff *); void roff_openeqn(struct roff *, const char *, |