diff options
author | 2018-08-16 13:54:06 +0000 | |
---|---|---|
committer | 2018-08-16 13:54:06 +0000 | |
commit | 31f17a62e510f4e0732d1c76e7a56a1a69506dc6 (patch) | |
tree | 3ebfa16f389b97a4bfa5988b198dad27b59d3fb5 /roff.c | |
parent | 44573b326d6604f3025f17909863711b17011d5f (diff) | |
download | mandoc-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 'roff.c')
-rw-r--r-- | roff.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.330 2018/08/10 04:41:25 schwarze Exp $ */ +/* $Id: roff.c,v 1.331 2018/08/16 13:54:06 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org> @@ -1367,6 +1367,19 @@ roff_res(struct roff *r, struct buf *buf, int ln, int pos) if (arg_complete) { deftype = ROFFDEF_USER | ROFFDEF_PRE; res = roff_getstrn(r, stnam, naml, &deftype); + + /* + * If not overriden, let \*(.T + * through to the formatters. + */ + + if (res == NULL && naml == 2 && + stnam[0] == '.' && stnam[1] == 'T') { + roff_setstrn(&r->strtab, + ".T", 2, NULL, 0, 0); + stesc--; + continue; + } } break; case 'B': |