From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (kristaps@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id o7G9bxBC027907 for ; Mon, 16 Aug 2010 05:38:00 -0400 (EDT) Received: (from kristaps@localhost) by krisdoz.my.domain (8.14.3/8.14.3/Submit) id o7G9bwfi029182; Mon, 16 Aug 2010 05:37:58 -0400 (EDT) Date: Mon, 16 Aug 2010 05:37:58 -0400 (EDT) Message-Id: <201008160937.o7G9bwfi029182@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: kristaps@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Add \v and \h to ignored escapes. X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Add \v and \h to ignored escapes. These are in the category of \s. Also made sign-less \s-style escapes be ok (this is technically against what's in the groff.7 manual, but seems pretty widespread). Noted by Thomas Jeunet as uglifying the gcc.1 manual. Modified Files: -------------- mdocml: mandoc.c out.c Revision Data ------------- Index: mandoc.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc.c,v retrieving revision 1.27 retrieving revision 1.28 diff -Lmandoc.c -Lmandoc.c -u -p -r1.27 -r1.28 --- mandoc.c +++ mandoc.c @@ -57,8 +57,6 @@ mandoc_special(char *p) /* FALLTHROUGH */ case ('w'): /* FALLTHROUGH */ - case ('v'): - /* FALLTHROUGH */ case ('S'): /* FALLTHROUGH */ case ('R'): @@ -91,13 +89,19 @@ mandoc_special(char *p) term = '\''; break; #endif + case ('h'): + /* FALLTHROUGH */ + case ('v'): + /* FALLTHROUGH */ case ('s'): if (ASCII_HYPH == *p) *p = '-'; - if ('+' == *p || '-' == *p) - p++; - i = ('s' != *(p - 1)); + i = 0; + if ('+' == *p || '-' == *p) { + p++; + i = 1; + } switch (*p++) { case ('('): @@ -110,7 +114,7 @@ mandoc_special(char *p) term = '\''; break; case ('0'): - i++; + i = 1; /* FALLTHROUGH */ default: len = 1; @@ -121,13 +125,11 @@ mandoc_special(char *p) if (ASCII_HYPH == *p) *p = '-'; if ('+' == *p || '-' == *p) { - if (i++) + if (i) return(0); p++; } - if (0 == i) - return(0); break; #if 0 case ('Y'): Index: out.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/out.c,v retrieving revision 1.23 retrieving revision 1.24 diff -Lout.c -Lout.c -u -p -r1.23 -r1.24 --- out.c +++ out.c @@ -240,11 +240,16 @@ a2roffdeco(enum roffdeco *d, const char break; } break; + case ('h'): + /* FALLTHROUGH */ + case ('v'): + /* FALLTHROUGH */ case ('s'): - if ('+' == wp[i] || '-' == wp[i]) + j = 0; + if ('+' == wp[i] || '-' == wp[i]) { i++; - - j = ('s' != wp[i - 1]); + j = 1; + } switch (wp[i++]) { case ('('): @@ -257,7 +262,7 @@ a2roffdeco(enum roffdeco *d, const char term = '\''; break; case ('0'): - j++; + j = 1; /* FALLTHROUGH */ default: i--; @@ -266,13 +271,11 @@ a2roffdeco(enum roffdeco *d, const char } if ('+' == wp[i] || '-' == wp[i]) { - if (j++) + if (j) return(i); i++; } - if (0 == j) - return(i); break; case ('['): *d = DECO_SPECIAL; -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv