]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
mdoc2man: support `Ns` inside `Ic`
authorArnout Engelen <arnout@bzzt.net>
Fri, 20 Jun 2025 19:36:44 +0000 (21:36 +0200)
committerDarren Tucker <dtucker@dtucker.net>
Tue, 14 Oct 2025 07:39:28 +0000 (18:39 +1100)
When encountering an `Ns` mdoc macro ('no space') inside an `Ic` block
('command'), such as for 'lines=number' in ssh-keygen.1, `mdoc2man`
just output the macro instead of processing it.

This adds processing for `Ns` when seen inside an `Ic` block.

mdoc2man.awk

index 02a04f7621d88a2a29866fb5a136dfec5d52e61a..469891965e78e4f2932ad3d86f064d95ccf709ac 100644 (file)
@@ -281,6 +281,12 @@ function add(str) {
          add("[")
          words[nwords]=words[nwords] "]"
        }
+       if(match(words[w],"^Ns$")) {
+         w++
+         if(!nospace)
+           nospace=1
+         sub(" $","",line)
+       }
        if(match(words[w],"^Ar$")) {
          add("\\fI" words[++w] "\\fP")
        } else if(match(words[w],"^[\\.,]")) {