emacs-devel
[Top][All Lists]
Advanced

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

Re: shell-command - missing shell-quote-argument for program?


From: Andreas Schwab
Subject: Re: shell-command - missing shell-quote-argument for program?
Date: Sat, 14 Oct 2006 19:50:01 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

Lennart Borgman <address@hidden> writes:

> Index: ada-xref.el
> ===================================================================
> RCS file: /cvsroot/emacs/emacs/lisp/progmodes/ada-xref.el,v
> retrieving revision 1.26
> diff -c -r1.26 ada-xref.el
> *** ada-xref.el    10 Feb 2006 09:00:31 -0000    1.26
> --- ada-xref.el    11 Oct 2006 22:55:48 -0000
> ***************
> *** 1916,1923 ****
>        (set-buffer (get-buffer-create "*grep*"))
>        (while dirs
>      (insert (shell-command-to-string
> !          (concat "egrep -i -h '^X|" regexp "( |$)' "
> !              (file-name-as-directory (car dirs)) "*.ali")))
>      (set 'dirs (cdr dirs)))
>
>        ;;  Now parse the output
> --- 1916,1926 ----
>        (set-buffer (get-buffer-create "*grep*"))
>        (while dirs
>      (insert (shell-command-to-string
> !          (concat "egrep -i -h '^X|"
> !                          (shell-quote-argument regexp)

This is wrong, the argument is already enclosed in single quotes.  There
is no need for further quoting, since the regexp cannot contain single
quotes (it is constructed from an Ada identifier).

Andreas.

-- 
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]