summaryrefslogtreecommitdiffstats
path: root/term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2010-07-03 16:02:12 +0000
committerIngo Schwarze <schwarze@openbsd.org>2010-07-03 16:02:12 +0000
commitbb8eca89831f88bbc271b59fb94e94b2db26ee1e (patch)
treea89a66e8a581c86f4a5ddb4614cdc8fe37f318a7 /term.c
parent63533c987d5ade538a926058188d4d64518a36f5 (diff)
downloadmandoc-bb8eca89831f88bbc271b59fb94e94b2db26ee1e.tar.gz
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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/term.c b/term.c
index e7c25879..248fd268 100644
--- a/term.c
+++ b/term.c
@@ -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);
}