Bug 237188 - security/openssh-portable: mdoc2man.awk mangles .Qq in man pages
Summary: security/openssh-portable: mdoc2man.awk mangles .Qq in man pages
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Walter Schwarzenfeld
Keywords: patch
Depends on:
Reported: 2019-04-11 01:19 UTC by Craig Leres
Modified: 2019-08-18 18:18 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (bdrewery)

patch (1.16 KB, text/plain)
2019-04-11 01:20 UTC, Craig Leres
leres: maintainer-approval?

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Leres freebsd_committer 2019-04-11 01:19:43 UTC
I noticed the string "Qq" appearing in the ssh_config(5) man page, for example:

              For example, Qq *.a.example.com:*.b.example.com,*.c.example.com
              will allow hostnames matching Qq *.a.example.com to be
              canonicalized to names in the Qq *.b.example.com or Qq
              *.c.example.com domains.

The first thing I noticed is that the distribution version of ssh_config.5 renders correctly without any massaging, e.g. "man ./ssh_config.5" shows:

             For example, "*.a.example.com:*.b.example.com,*.c.example.com"
             will allow hostnames matching "*.a.example.com" to be
             canonicalized to names in the "*.b.example.com" or
             "*.c.example.com" domains.

So one solution would be to remove the use of mdoc2man.awk from the Makefile.

Meanwhile mdoc(7) says this about .Qq:

     Qq, Qo, Qc       enclose in typewriter double quotes: "text"

So here's a patch that adds .Qq support to mdoc2man.awk.
Comment 1 Craig Leres freebsd_committer 2019-04-11 01:20:24 UTC
Created attachment 203572 [details]
Comment 2 Walter Schwarzenfeld freebsd_triage 2019-08-18 18:18:30 UTC
The change is slightly different in the source code:

    107     } else if(match(words[w],"^Dq$")) {
    108       skip=1
    109       add("``")
    110       add(words[++w])
    111       while(w<nwords&&!match(words[w+1],"^[\\.,]"))
    112         add(OFS words[++w])
    113       add("''")
    114       if(!nospace&&match(words[w+1],"^[\\.,]"))
    115         nospace=1
    116     } else if(match(words[w],"^Sq|Ql$")) {
    117       skip=1
    118       add("`" words[++w] "'")
    119       if(!nospace&&match(words[w+1],"^[\\.,]"))
    120         nospace=1