Subject: | Mail::Cap on \\ |
Date: | Mon, 28 Oct 2013 10:32:07 +1100 |
To: | bug-mailtools [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
I believe mailcap files can contain \\ to mean a literal backslash, but
Mail::Cap does not undo that backslash when it runs or returns a
command.
For example foo.pl below run on the sample mailcap file below prints
echo \\"
sh: 1: Syntax error: Unterminated quoted string
where I expected
echo \"
"
I think RFC 1524 is to be read as "qchar" backslash escaping any char,
in particular \\ to escape a backslash. There's an example \\ in the
draft amended appendix B of
http://www.ietf.org/archive/id/draft-borenstein-mailcap-00.ps though as
far as I know that draft was not formally adopted.
I struck this with Debian zgv which had a complicated test using a
regexp on the name of the tty,
test=expr "`/usr/bin/tty`" : '/dev/\\(tty\\|vc/\\)[0-9][0-9]*' >/dev/null 2>&1 || expr "$STY" : '[0-9][0-9]*\\.tty[0-9][0-9]*\\.'`hostname`'$' >/dev/null 2>&1
This test passes the debian run-mailcap, but does not pass Mail::Cap.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.