Bug 237188

Summary: security/openssh-portable: mdoc2man.awk mangles .Qq in man pages
Product: Ports & Packages Reporter: Craig Leres <leres>
Component: Individual Port(s)Assignee: Walter Schwarzenfeld <w.schwarzenfeld>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: w.schwarzenfeld
Priority: --- Keywords: patch
Version: LatestFlags: bugzilla: maintainer-feedback? (bdrewery)
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch leres: maintainer-approval?

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]
patch
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