[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Mailcap question: should %s be quoted?



On Mon, Apr 18, 2005 at 01:45:02PM -0700, Bill Moseley wrote:
> On Mon, Apr 18, 2005 at 10:18:22PM +0200, Almut Behrens wrote:
> > I still don't seem to be able to reproduce the problem.
> 
> Here's what I did:
> 
>     $ strace mutt -a 'test doc.pdf' moseley 2>strace.out
> 
>     Accept the address, enter some subject and then exit my editor
>     (vim) and down arrow to highlight the attached file and hit
>     return.
> 
>     Then after exiting mutt:
> 
>     $ fgrep test strace.out 
>     execve("/usr/bin/mutt", ["mutt", "-a", "test doc.pdf", "moseley"], [/* 22 vars */]) = 0
>     stat64("test doc.pdf", {st_mode=S_IFREG|0644, st_size=111204, ...}) = 0
>     open("test doc.pdf", O_RDONLY|O_LARGEFILE) = 3
>     stat64("test doc.pdf", {st_mode=S_IFREG|0644, st_size=111204, ...}) = 0
>     open("test doc.pdf", O_RDONLY|O_LARGEFILE) = 3
>     stat64("test doc.pdf", {st_mode=S_IFREG|0644, st_size=111204, ...}) = 0
>     stat64("test doc.pdf", {st_mode=S_IFREG|0644, st_size=111204, ...}) = 0
>     read(3, " test=test -n \"$DISPLAY\"\nimage/x"..., 4096) = 2385
>     lstat64("/tmp/test_doc.pdf", 0xbfffda50) = -1 ENOENT (No such file or directory)
>     waitpid(31137, Error: Couldn't open file 'test'
>     stat64("test doc.pdf", {st_mode=S_IFREG|0644, st_size=111204, ...}) = 0
> 
> Notice that message from xpdf above for just 'test'.  This is what is
> happening:
> 
>     $ xpdf test doc.pdf 
>     Error: Couldn't open file 'test'
> 
> Mutt 1.5.8i (2005-02-12)


Here's what I get with Mutt 1.4.2.1i:

$ strace -f mutt -a 'test doc.pdf' almut_behrens  2>strace.out
...

$ grep test strace.out
execve("/usr/local/bin/mutt", ["mutt", "-a", "test doc.pdf", "almut_behrens"], [/* 21 vars */]) = 0
stat64("test doc.pdf", {st_mode=S_IFREG|0600, st_size=27033, ...}) = 0
open("test doc.pdf", O_RDONLY)          = 3
stat64("test doc.pdf", {st_mode=S_IFREG|0600, st_size=27033, ...}) = 0
open("test doc.pdf", O_RDONLY)          = 3
stat64("test doc.pdf", {st_mode=S_IFREG|0600, st_size=27033, ...}) = 0
stat64("test doc.pdf", {st_mode=S_IFREG|0600, st_size=27033, ...}) = 0
lstat64("/home/almut/.mutt/tmp/test_doc.pdf", 0xbfffda3c) = -1 ENOENT (No such file or directory)
unlink("/home/almut/.mutt/tmp/test_doc.pdf") = -1 ENOENT (No such file or directory)
symlink("/home/almut/test doc.pdf", "/home/almut/.mutt/tmp/test_doc.pdf") = 0
stat64("test doc.pdf", {st_mode=S_IFREG|0600, st_size=27033, ...}) = 0
stat64("/home/almut/.mutt/tmp/test_doc.pdf", {st_mode=S_IFREG|0600, st_size=27033, ...}) = 0
[pid 31508] execve("/usr/local/bin/acroread", ["acroread", "/home/almut/.mutt/tmp/test_doc.pdf"], [/* 20 vars */]) = 0
unlink("/home/almut/.mutt/tmp/test_doc.pdf") = 0
stat64("test doc.pdf", {st_mode=S_IFREG|0600, st_size=27033, ...}) = 0


As it looks, they've reintroduced a bug (or, at least, questionable
behaviour) somewhere in between 1.4.2.1i and 1.5.8i.  To me, creating a
symlink seems like a decent thing to do here...  Strange.

Almut



Reply to: