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>
This commit is contained in:
Arnout Engelen
2024-10-18 13:42:38 +02:00
committed by Darren Tucker
parent 8eabd2ae2c
commit 74d70841ef

View File

@@ -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)