From 365ec00baacbf68996ec61890a67247e7e2c661e Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Tue, 24 Aug 2010 12:18:48 +0000 Subject: Strip out the `\z' escape. This is the first recursive sequence, getting mandoc ready to handle pod2man's complex escapes. --- man.7 | 2 ++ mandoc.c | 7 +++++++ mdoc.7 | 2 ++ out.c | 11 ++++++++++- 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/man.7 b/man.7 index da2c30f5..52a8917b 100644 --- a/man.7 +++ b/man.7 @@ -936,6 +936,8 @@ The .Pq text colour , .Sq \eM .Pq text filling colour , +.Sq \ez +.Pq zero-length character , and .Sq \es .Pq text size diff --git a/mandoc.c b/mandoc.c index 24e3d554..cd12a966 100644 --- a/mandoc.c +++ b/mandoc.c @@ -171,6 +171,13 @@ mandoc_special(char *p) case ('['): term = ']'; break; + case ('z'): + len = 1; + if ('\\' == *p) { + p += mandoc_special(p); + return(*p ? (int)(p - sv) : 0); + } + break; default: len = 1; p--; diff --git a/mdoc.7 b/mdoc.7 index c6f7303d..1cc2a0bf 100644 --- a/mdoc.7 +++ b/mdoc.7 @@ -2844,6 +2844,8 @@ The .Pq text colour , .Sq \eM .Pq text filling colour , +.Sq \ez +.Pq zero-length character , and .Sq \es .Pq text size diff --git a/out.c b/out.c index 15ffd5e4..fa3049e0 100644 --- a/out.c +++ b/out.c @@ -172,6 +172,7 @@ a2roffdeco(enum roffdeco *d, const char **word, size_t *sz) int i, j, lim; char term, c; const char *wp; + enum roffdeco dd; *d = DECO_NONE; lim = i = 0; @@ -275,7 +276,7 @@ a2roffdeco(enum roffdeco *d, const char **word, size_t *sz) return(i); i++; } - + break; case ('['): *d = DECO_SPECIAL; @@ -284,6 +285,14 @@ a2roffdeco(enum roffdeco *d, const char **word, size_t *sz) case ('c'): *d = DECO_NOSPACE; return(i); + case ('z'): + *d = DECO_NONE; + if ('\\' == wp[i]) { + *word = &wp[++i]; + return(i + a2roffdeco(&dd, word, sz)); + } else + lim = 1; + break; default: *d = DECO_SSPECIAL; i--; -- cgit