diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2010-07-03 16:02:12 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2010-07-03 16:02:12 +0000 |
commit | d88ee3ac2243555d08d940053b987b819361b703 (patch) | |
tree | 1e3adc475acbd138f2199a5fcf04bfe7c3d70d10 /term.c | |
parent | 6c211ca8c9060f52eb0d64f7735bd4d4d565d486 (diff) | |
download | mandoc-d88ee3ac2243555d08d940053b987b819361b703.tar.gz mandoc-d88ee3ac2243555d08d940053b987b819361b703.tar.zst mandoc-d88ee3ac2243555d08d940053b987b819361b703.zip |
Rudimentary implementation of user-defined strings;
no time for more refinement right now.
In particular, fixes terminfo(3) and mdoc.samples(7).
ok kristaps@, who will add the HTML frontend bits
Diffstat (limited to 'term.c')
-rw-r--r-- | term.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.157 2010/07/02 10:50:50 kristaps Exp $ */ +/* $Id: term.c,v 1.158 2010/07/03 16:02:12 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -30,6 +30,7 @@ #include "mandoc.h" #include "chars.h" #include "out.h" +#include "regs.h" #include "term.h" #include "main.h" @@ -377,6 +378,11 @@ res(struct termp *p, const char *word, size_t len) size_t sz; rhs = chars_a2res(p->symtab, word, len, &sz); + if (NULL == rhs) { + rhs = roff_getstrn(word, len); + if (rhs) + sz = strlen(rhs); + } if (rhs) encode(p, rhs, sz); } |