<<< Date Index >>>     <<< Thread Index >>>

Re: Spaces in attached file names



On Tue, Mar 08, 2005 at 06:05:22AM +0100, Thomas Roessler wrote:
> On 2005-03-07 17:25:22 -0800, Bill Moseley wrote:
> 
> > Is this a problem in my mailcap file?  Doesn't seem so as %s is
> > quoted.  So is mutt not sending the entire path?
> 
> Yes, there's a problem with your mailcap file.  Please remove the
> single ticks around the %s, as mutt adds the necessary quoting
> itself.

Ok.  So my first thought was how can that be correct?  First, I don't
see why an extra set of quote would make a difference.  Indeed, if I
set my mailcap to

  application/pdf; /usr/bin/xpdf ''%s''; ...

then "run-mailcap 'test doc.pdf'" works just fine.  But if I remove
the quotes mutt works, as you say, but other uses of mailcap do not
work:

    $ run-mailcap 'test doc.pdf' 
    Error: Couldn't open file 'test'

And second, every %s in my mailcap has quotes -- and they make sense
to me.  I expect my Debian mailcap file is ok, so I'm back to thinking
it's a problem with mutt.

I tried to run strace on mutt.  It seems to fork so I used -f, but
then I get too much.  I do see:

[pid 30542] execve("/bin/sh", ["sh", "-c", "/usr/bin/xpdf \'\'../test 
doc.pdf\'"...], [/* 22 vars */]) = 0

But I'm not sure if strace is adding those backslashes or if that's
the actual value passed to /bin/sh.  Then later I see this:

[pid 30542] execve("/usr/bin/xpdf", ["/usr/bin/xpdf", "../test", "doc.pdf"], 
[/* 21 vars */]) = 0

Can someone give me a pointer into the mutt source where this is
handled?


-- 
Bill Moseley
moseley@xxxxxxxx