tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Kristaps Dzonsons <kristaps@bsd.lv>
To: tech@mdocml.bsd.lv
Cc: Ingo Schwarze <schwarze@usta.de>, Jason McIntyre <jmc@cava.myzen.co.uk>
Subject: Re: [PATCH] \N'nnn' protection.
Date: Sun, 01 May 2011 01:18:51 +0200	[thread overview]
Message-ID: <4DBC98DB.2070204@bsd.lv> (raw)
In-Reply-To: <20110430225932.GB9889@iris.usta.de>

>> Enclosed is a patch to limit possible \N'nnn' escapes.  \N
>> transforms the number 'nnn' into its character representation and is
>> marked as "for backwards compatibility" in mandoc_char(7).
>>
>> I can only find manuals using this for the double-quote \N'34', so
>> this seems safe, but maybe one of you knows of crazy \N usage that
>> would inspire me to re-think.
>
> None known, and little wonder, as it would be a bad idea because it's
> inherently non-portable even among systems supporting \N.
>
>> However, throwing, e.g., the \b
>> character in there will cause at least -Tps and -Tpdf to puke.
>>
>> Thoughts?
>
> Maybe isprint(3)?

Ingo,

That'll do it.  I wasn't sure if "printable characters including the 
space" meant "including whitespace", i.e., newlines.  However, I checked 
on BSD, Linux, and Mac, and it seems that this is not the case.

Thus, I'll check in isprint() tomorrow.

Thanks!

Kristaps
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

      reply	other threads:[~2011-04-30 23:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-30 22:37 Kristaps Dzonsons
2011-04-30 22:59 ` Ingo Schwarze
2011-04-30 23:18   ` Kristaps Dzonsons [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DBC98DB.2070204@bsd.lv \
    --to=kristaps@bsd.lv \
    --cc=jmc@cava.myzen.co.uk \
    --cc=schwarze@usta.de \
    --cc=tech@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).