diff options
author | ru <ru@FreeBSD.org> | 2002-05-22 11:08:41 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2002-05-22 11:08:41 +0000 |
commit | db664693ee0d8a3b58f2e0a6a4803da573813dbc (patch) | |
tree | 32b98eb2f4609d829b202ebcdc5bfbaa8fc31945 /usr.bin/makewhatis | |
parent | 7676c223e074baf1d2bd110532edd52e42273905 (diff) | |
download | FreeBSD-src-db664693ee0d8a3b58f2e0a6a4803da573813dbc.zip FreeBSD-src-db664693ee0d8a3b58f2e0a6a4803da573813dbc.tar.gz |
Unroff all forms of \f and \*, and the simplest form of \s.
Submitted by: fenner, ru
Reviewed by: ru, fenner
Diffstat (limited to 'usr.bin/makewhatis')
-rw-r--r-- | usr.bin/makewhatis/makewhatis.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/usr.bin/makewhatis/makewhatis.c b/usr.bin/makewhatis/makewhatis.c index c9a217d..f6dec49 100644 --- a/usr.bin/makewhatis/makewhatis.c +++ b/usr.bin/makewhatis/makewhatis.c @@ -498,7 +498,9 @@ name_section_line(char *line, const char *section_start) /* * Copies characters while removing the most common nroff/troff * markup: - * \(em, \(mi, \fR, \f(XX, \*p, \&, + * \(em, \(mi, \s[+-N], \& + * \fF, \f(fo, \f[font] + * \*s, \*(st, \*[stringvar] */ static char * de_nroff_copy(char *from, char *to, int fromlen) @@ -515,18 +517,22 @@ de_nroff_copy(char *from, char *to, int fromlen) continue; } break; + case 's': + if (*++from == '-') + from++; + while (isdigit(*from)) + from++; + continue; case 'f': + case '*': if (*++from == '(') from += 3; - else + else if (*from == '[') { + while (*++from != ']' && from < from_end); + from++; + } else from++; continue; - case '*': - if (from[1] == 'p') { - from += 2; - continue; - } - break; case '&': from++; continue; |