Re: [PATCH] ssh.1: balance square brackets in the synopsis

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 



On Sun, Oct 20, 2024, at 00:12, Christian Weisgerber wrote:
> > I noticed the square brackets in `destination [command [argument...]`
> > were not balanced,
> 
> But they are.  Not only with mandoc(1), but also with groff(1).

Ah, indeed! Apparently the manpage is processed by mdoc2man.awk where the nesting is lost. This looks like it fixes it more neatly:

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)

_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev



[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux