summaryrefslogtreecommitdiffstats
path: root/mdoc2man.awk
diff options
context:
space:
mode:
authorArnout Engelen <arnout@bzzt.net>2024-10-18 13:42:38 +0200
committerDarren Tucker <dtucker@dtucker.net>2024-11-28 09:20:10 +0100
commit74d70841efbf41b9fcc8e6f6f4777d2e9d7e2004 (patch)
tree468bebace47dcbebe0e7be05b6c93d514d93ff5f /mdoc2man.awk
parentupstream: fix argument of "Compression" directive in ssh -G config (diff)
downloadopenssh-74d70841efbf41b9fcc8e6f6f4777d2e9d7e2004.tar.xz
openssh-74d70841efbf41b9fcc8e6f6f4777d2e9d7e2004.zip
mdoc2man: balance nested square brackets
I noticed the square brackets in `destination [command [argument...]` in the synopsis for the `ssh.1` manpage were not balanced, this balances them. Signed-off-by: Arnout Engelen <arnout@bzzt.net>
Diffstat (limited to '')
-rw-r--r--mdoc2man.awk4
1 files changed, 2 insertions, 2 deletions
diff --git a/mdoc2man.awk b/mdoc2man.awk
index d393ae6f1..02a04f762 100644
--- a/mdoc2man.awk
+++ b/mdoc2man.awk
@@ -239,7 +239,7 @@ function add(str) {
while(w<nwords&&match(words[w+1],"^[\\.,:;)]"))
add(words[++w])
} else if(match(words[w],"^Op$")) {
- option=1
+ option++
if(!nospace)
nospace=1
add("[")
@@ -358,7 +358,7 @@ function add(str) {
add(")")
if(angles)
add(">")
- if(option)
+ for(;option;option--)
add("]")
if(ext&&!extopt&&!match(line," $"))
add(OFS)