|
From: | Lennart Borgman |
Subject: | Re: shell-command - missing shell-quote-argument for program? |
Date: | Sun, 15 Oct 2006 21:13:18 +0200 |
User-agent: | Thunderbird 1.5.0.7 (Windows/20060909) |
Richard Stallman wrote:
If we quote emerge-command and the various emerge-*-program, we in effect disallow them to be shell commands with switches. Is that reasonable? If it is, then we should quote the programs. If that's what these variables do, their values should not be quoted, so that they can include some arguments.
Ok.
> - defcustom explicit-bash-args Since that exists only to be sent as arguments, it should not be quoted. The user will put in whatever quoting is called for.
That is a misunderstanding. It is the variable prog inside that defcustom that should be quoted with shell-quote-argument. prog must point to a file so there is no problem here.
I have attached a patch.
Index: lisp/shell.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/shell.el,v retrieving revision 1.140 diff -c -r1.140 shell.el *** lisp/shell.el 2 Sep 2006 23:30:21 -0000 1.140 --- lisp/shell.el 15 Oct 2006 19:11:30 -0000 *************** *** 293,299 **** (equal name "bash") (file-executable-p prog) (string-match "bad option" ! (shell-command-to-string (concat prog " --noediting")))) '("-i") '("--noediting" "-i"))) "Args passed to inferior shell by \\[shell], if the shell is bash. --- 293,300 ---- (equal name "bash") (file-executable-p prog) (string-match "bad option" ! (shell-command-to-string ! (concat (shell-quote-argument prog) " --noediting")))) '("-i") '("--noediting" "-i"))) "Args passed to inferior shell by \\[shell], if the shell is bash.
[Prev in Thread] | Current Thread | [Next in Thread] |