🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.vm.bug
Article #687

Re: Can't launch attachments with "spaces" in file name

#687
From: Jeffrey J. Kosowsky
Date: Tue, 20 Jan 2004 05:27
47 lines
2974 bytes
Kevin Rodgers <ihs_4664@yahoo.com> writes:
> Jeffrey J. Kosowsky wrote:
> 
> > I am really enjoying the ability added in VM-7.18 that launches
> > attachments under their actual file name as opposed to just using a
> > random temp file name.
> > However, I have noticed that files with spaces in them fail to launch
> > properly, though the file itself is detached to the temp directory under the
> > proper full file name.
> > I imagine that this is probably due to file names not being properly
> > quoted to preserve spaces and other such non-alphanumeric characters.
> > Any thoughts where source of error is and how to fix?
> 
> Such file names should only cause a problem if the external program is launched
> via the shell.  Does this patch to vm-mime-display-external-generic help?
> 
> *** vm-7.18/vm-mime.el.orig	Mon Oct 13 13:30:18 2003
> --- vm-7.18/vm-mime.el	Mon Jan 12 15:29:13 2004
> ***************
> *** 2003,2008 ****
> --- 2003,2012 ----
>    	       (write-region start end tempfile nil 0)
>    	       (delete-region start end))))
> 
> +       ;; quote file name for shell command only
> +       (or (cdr program-list)
> +           (setq tempfile (shell-quote-argument tempfile)))
> +
>          ;; expand % specs
>          (let ((p program-list)
>    	    (vm-mf-attachment-file tempfile))

Thanks... this seems to correct the problem with files with spaces.
Can we get Kyle to include the above patch in the next release of vm?

However, I have now noticed another problem. If there already is
another version of the file in the temp directory with the same name,
then vm just hangs in opening the file. 

A better alternative might be to first check if the stored file is
identical. If so, then just open the existing temp file, if not then
store the file with a modified file name, such as <filename>.1

In any case the current "hanging" response should be fixed, right?

Thanks,
Jeff
Technical Details
Message-ID: <m2k73n2nrb.fsf@consult.pretender>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!wn14feed!worldnet.att.net!199.45.49.37!cyclone1.gnilink.net!spamkiller2.gnilink.net!nwrdny03.gnilink.net.POSTED!9056c659!not-for-mail
References: <m2fzekj10g.fsf@consult.pretender> <400320B7.5060408@yahoo.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f6829,6e83a1235cadfbbe
X-Google-Attributes: gidf6829,public
X-Google-ArrivalTime: 2004-01-19 21:27:21 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!wn14feed!worldnet.att.net!199.45.49.37!cyclone1.gnilink.net!spamkiller2.gnilink.net!nwrdny03.gnilink.net.POSTED!9056c659!not-for-mail
Newsgroups: gnu.emacs.vm.bug
Subject: Re: Can't launch attachments with "spaces" in file name
References: <m2fzekj10g.fsf@consult.pretender> <400320B7.5060408@yahoo.com>
From: kosowsky@consult.pretender (Jeffrey J. Kosowsky)
Message-ID: <m2k73n2nrb.fsf@consult.pretender>
Lines: 50
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Date: Tue, 20 Jan 2004 05:27:20 GMT
NNTP-Posting-Host: 141.154.120.29
X-Complaints-To: abuse@verizon.net
X-Trace: nwrdny03.gnilink.net 1074576440 141.154.120.29 (Tue, 20 Jan 2004 00:27:20 EST)
NNTP-Posting-Date: Tue, 20 Jan 2004 00:27:20 EST