aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-08-24 12:18:48 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-08-24 12:18:48 +0000
commit3734245a5a164c1ba48ac02cb3131143431b996b (patch)
tree6586c23c6f21da438aab9837f48deacc6e640c55
parent8f9f46b6458dea1bcb7ba265c47247d2858f6351 (diff)
downloadmandoc-3734245a5a164c1ba48ac02cb3131143431b996b.tar.gz
mandoc-3734245a5a164c1ba48ac02cb3131143431b996b.tar.zst
mandoc-3734245a5a164c1ba48ac02cb3131143431b996b.zip
Strip out the `\z' escape. This is the first recursive sequence,
getting mandoc ready to handle pod2man's complex escapes.
-rw-r--r--man.76
-rw-r--r--mandoc.c9
-rw-r--r--mdoc.76
-rw-r--r--out.c13
4 files changed, 27 insertions, 7 deletions
diff --git a/man.7 b/man.7
index 9e14d6db..2a78c146 100644
--- a/man.7
+++ b/man.7
@@ -1,4 +1,4 @@
-.\" $Id: man.7,v 1.82 2010/08/22 14:54:29 kristaps Exp $
+.\" $Id: man.7,v 1.83 2010/08/24 12:18:48 kristaps Exp $
.\"
.\" Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: August 22 2010 $
+.Dd $Mdocdate: August 24 2010 $
.Dt MAN 7
.Os
.Sh NAME
@@ -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 53e7c7b6..5505c5f3 100644
--- a/mandoc.c
+++ b/mandoc.c
@@ -1,4 +1,4 @@
-/* $Id: mandoc.c,v 1.29 2010/08/20 01:02:07 schwarze Exp $ */
+/* $Id: mandoc.c,v 1.30 2010/08/24 12:18:48 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -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 c343690c..12ff50fd 100644
--- a/mdoc.7
+++ b/mdoc.7
@@ -1,4 +1,4 @@
-.\" $Id: mdoc.7,v 1.151 2010/08/22 15:49:28 kristaps Exp $
+.\" $Id: mdoc.7,v 1.152 2010/08/24 12:18:49 kristaps Exp $
.\"
.\" Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -15,7 +15,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: August 22 2010 $
+.Dd $Mdocdate: August 24 2010 $
.Dt MDOC 7
.Os
.Sh NAME
@@ -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 20d4a915..5bc69ca2 100644
--- a/out.c
+++ b/out.c
@@ -1,4 +1,4 @@
-/* $Id: out.c,v 1.24 2010/08/16 09:37:58 kristaps Exp $ */
+/* $Id: out.c,v 1.25 2010/08/24 12:18:49 kristaps Exp $ */
/*
* Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -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--;