aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-08-16 13:54:06 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-08-16 13:54:06 +0000
commit31f17a62e510f4e0732d1c76e7a56a1a69506dc6 (patch)
tree3ebfa16f389b97a4bfa5988b198dad27b59d3fb5 /mandoc.c
parent44573b326d6604f3025f17909863711b17011d5f (diff)
downloadmandoc-31f17a62e510f4e0732d1c76e7a56a1a69506dc6.tar.gz
mandoc-31f17a62e510f4e0732d1c76e7a56a1a69506dc6.tar.zst
mandoc-31f17a62e510f4e0732d1c76e7a56a1a69506dc6.zip
Implement the \*(.T predefined string (interpolate device name)
by allowing the preprocessor to pass it through to the formatters. Used for example by the groff_char(7) manual page.
Diffstat (limited to 'mandoc.c')
-rw-r--r--mandoc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/mandoc.c b/mandoc.c
index aaccd339..275688b6 100644
--- a/mandoc.c
+++ b/mandoc.c
@@ -1,4 +1,4 @@
-/* $Id: mandoc.c,v 1.105 2018/08/10 22:12:44 schwarze Exp $ */
+/* $Id: mandoc.c,v 1.106 2018/08/16 13:54:06 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -139,6 +139,13 @@ mandoc_escape(const char **end, const char **start, int *sz)
break;
}
break;
+ case '*':
+ if (strncmp(*start, "(.T", 3) != 0)
+ abort();
+ gly = ESCAPE_DEVICE;
+ *start = ++*end;
+ *sz = 2;
+ break;
/*
* These escapes are of the form \X'Y', where 'X' is the trigger