aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-01-21 20:33:25 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-01-21 20:33:25 +0000
commit2c8780108e37e85285813e3f999444c3e861a456 (patch)
tree6539e8d252bac96f53212ea11bb5ea88a23d2379 /mandoc.c
parent73f85b8d5a3ab767a78772963e344e8759ccb1d7 (diff)
downloadmandoc-2c8780108e37e85285813e3f999444c3e861a456.tar.gz
mandoc-2c8780108e37e85285813e3f999444c3e861a456.tar.zst
mandoc-2c8780108e37e85285813e3f999444c3e861a456.zip
Rudimentary implementation of the roff(7) \o escape sequence (overstrike).
This is of some relevance because the pod2man(1) preamble abuses it for the icelandic letter Thorn, instead of simply using \(TP and \(Tp. Missing feature found by sthen@ in DateTime::Locale::is_IS(3p).
Diffstat (limited to 'mandoc.c')
-rw-r--r--mandoc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/mandoc.c b/mandoc.c
index 4975df00..a61d2331 100644
--- a/mandoc.c
+++ b/mandoc.c
@@ -1,4 +1,4 @@
-/* $Id: mandoc.c,v 1.90 2015/01/01 18:11:45 schwarze Exp $ */
+/* $Id: mandoc.c,v 1.91 2015/01/21 20:33:25 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -156,16 +156,18 @@ mandoc_escape(const char **end, const char **start, int *sz)
/* FALLTHROUGH */
case 'D':
/* FALLTHROUGH */
- case 'o':
- /* FALLTHROUGH */
case 'R':
/* FALLTHROUGH */
case 'X':
/* FALLTHROUGH */
case 'Z':
- if ('\0' == **start)
- return(ESCAPE_ERROR);
gly = ESCAPE_IGNORE;
+ /* FALLTHROUGH */
+ case 'o':
+ if (**start == '\0')
+ return(ESCAPE_ERROR);
+ if (gly == ESCAPE_ERROR)
+ gly = ESCAPE_OVERSTRIKE;
term = **start;
*start = ++*end;
break;