From b3551ad9fb0869609872a1a394a66f9c202be518 Mon Sep 17 00:00:00 2001 From: schwarze Date: Wed, 25 Dec 2013 22:45:16 +0000 Subject: [PATCH] Parse and ignore the roff(7) escape sequences \d (move half line down) und \u (move half line up). Found by bentley@ in some DocBook crap. Surprisingly, these two do actually occur in our terminfo(5), so this patch reduces groff-mandoc differences in base by 0.03%. --- usr.bin/mandoc/mandoc.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/usr.bin/mandoc/mandoc.c b/usr.bin/mandoc/mandoc.c index af93d8ea8b8..43de450cc37 100644 --- a/usr.bin/mandoc/mandoc.c +++ b/usr.bin/mandoc/mandoc.c @@ -1,4 +1,4 @@ -/* $Id: mandoc.c,v 1.40 2013/12/25 00:50:03 schwarze Exp $ */ +/* $Id: mandoc.c,v 1.41 2013/12/25 22:45:16 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2012, 2013 Ingo Schwarze @@ -97,6 +97,14 @@ mandoc_escape(const char const **end, const char const **start, int *sz) term = '\''; break; + /* + * Escapes taking no arguments at all. + */ + case ('d'): + /* FALLTHROUGH */ + case ('u'): + return(ESCAPE_IGNORE); + /* * The \z escape is supposed to output the following * character without advancing the cursor position. -- 2.20.1