diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-08-16 09:37:58 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-08-16 09:37:58 +0000 |
commit | 50e5e6079cf836d29fcbcd19b59c694b205d4caa (patch) | |
tree | 40e4b7eb62afd5662ffe4d32a06010e30cf11675 /out.c | |
parent | c75a70fe96c444404797d0ca3abc9edf5076a713 (diff) | |
download | mandoc-50e5e6079cf836d29fcbcd19b59c694b205d4caa.tar.gz mandoc-50e5e6079cf836d29fcbcd19b59c694b205d4caa.tar.zst mandoc-50e5e6079cf836d29fcbcd19b59c694b205d4caa.zip |
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.
Diffstat (limited to 'out.c')
-rw-r--r-- | out.c | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -1,4 +1,4 @@ -/* $Id: out.c,v 1.23 2010/07/22 23:03:15 kristaps Exp $ */ +/* $Id: out.c,v 1.24 2010/08/16 09:37:58 kristaps Exp $ */ /* * Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -240,11 +240,16 @@ a2roffdeco(enum roffdeco *d, const char **word, size_t *sz) 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 **word, size_t *sz) term = '\''; break; case ('0'): - j++; + j = 1; /* FALLTHROUGH */ default: i--; @@ -266,13 +271,11 @@ a2roffdeco(enum roffdeco *d, const char **word, size_t *sz) } if ('+' == wp[i] || '-' == wp[i]) { - if (j++) + if (j) return(i); i++; } - if (0 == j) - return(i); break; case ('['): *d = DECO_SPECIAL; |