]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
mdoc2man: balance nested square brackets
authorArnout Engelen <arnout@bzzt.net>
Fri, 18 Oct 2024 11:42:38 +0000 (13:42 +0200)
committerDarren Tucker <dtucker@dtucker.net>
Thu, 28 Nov 2024 08:20:10 +0000 (19:20 +1100)
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>
mdoc2man.awk

index d393ae6f1476c7b743edc0d9efe94590da613d32..02a04f7621d88a2a29866fb5a136dfec5d52e61a 100644 (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)