From a8e06cef35c205e1aa562513c6d034a10c8c9a6d Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Fri, 21 Nov 2003 23:48:55 +1100 Subject: - djm@cvs.openbsd.org 2003/11/21 11:57:03 [everything] unexpand and delete whitespace at EOL; ok markus@ (done locally and RCS IDs synced) --- mdoc2man.awk | 158 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 79 insertions(+), 79 deletions(-) (limited to 'mdoc2man.awk') diff --git a/mdoc2man.awk b/mdoc2man.awk index 856e2d7c..9135af07 100644 --- a/mdoc2man.awk +++ b/mdoc2man.awk @@ -76,19 +76,19 @@ function add(str) { skip=1 ext=1 if(length(line)&&!(match(line," $")||prenl)) - add(OFS) + add(OFS) } else if(match(words[w],"^Xc$")) { skip=1 ext=0 if(!extopt) - prenl++ + prenl++ w=nwords } else if(match(words[w],"^Bd$")) { skip=1 if(match(words[w+1],"-literal")) { - literal=1 - prenl++ - w=nwords + literal=1 + prenl++ + w=nwords } } else if(match(words[w],"^Ed$")) { skip=1 @@ -96,7 +96,7 @@ function add(str) { } else if(match(words[w],"^Ns$")) { skip=1 if(!nospace) - nospace=1 + nospace=1 sub(" $","",line) } else if(match(words[w],"^No$")) { skip=1 @@ -107,20 +107,20 @@ function add(str) { add("``") add(words[++w]) while(w0;i--) { - add(refauthors[i]) - if(i>1) - add(", ") + add(refauthors[i]) + if(i>1) + add(", ") } if(nrefauthors>1) - add(" and ") + add(" and ") add(refauthors[0] ", \\fI" reftitle "\\fP") if(length(refissue)) - add(", " refissue) + add(", " refissue) if(length(refdate)) - add(", " refdate) + add(", " refdate) if(length(refopt)) - add(", " refopt) + add(", " refopt) add(".") reference=0 } else if(reference) { if(match(words[w],"^%A$")) { refauthors[nrefauthors++]=wtail() } if(match(words[w],"^%T$")) { - reftitle=wtail() - sub("^\"","",reftitle) - sub("\"$","",reftitle) + reftitle=wtail() + sub("^\"","",reftitle) + sub("\"$","",reftitle) } if(match(words[w],"^%N$")) { refissue=wtail() } if(match(words[w],"^%D$")) { refdate=wtail() } if(match(words[w],"^%O$")) { refopt=wtail() } } else if(match(words[w],"^Nm$")) { if(synopsis) { - add(".br") - prenl++ + add(".br") + prenl++ } n=words[++w] if(!length(name)) - name=n + name=n if(!length(n)) - n=name + n=name add("\\fB" n "\\fP") if(!nospace&&match(words[w+1],"^[\\.,]")) - nospace=1 + nospace=1 } else if(match(words[w],"^Nd$")) { add("\\- " wtail()) } else if(match(words[w],"^Fl$")) { add("\\fB\\-" words[++w] "\\fP") if(!nospace&&match(words[w+1],"^[\\.,]")) - nospace=1 + nospace=1 } else if(match(words[w],"^Ar$")) { add("\\fI") if(w==nwords) - add("file ...\\fP") + add("file ...\\fP") else { - add(words[++w] "\\fP") - while(match(words[w+1],"^\\|$")) - add(OFS words[++w] " \\fI" words[++w] "\\fP") + add(words[++w] "\\fP") + while(match(words[w+1],"^\\|$")) + add(OFS words[++w] " \\fI" words[++w] "\\fP") } if(!nospace&&match(words[w+1],"^[\\.,]")) - nospace=1 + nospace=1 } else if(match(words[w],"^Cm$")) { add("\\fB" words[++w] "\\fP") while(w