[Top][All Lists]

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

Re: Quote file name args to start-process-shell-command?

From: Eli Zaretskii
Subject: Re: Quote file name args to start-process-shell-command?
Date: Thu, 12 Oct 2006 03:03:20 -0400

> Date: Thu, 12 Oct 2006 08:08:08 +0200
> From: Lennart Borgman <address@hidden>
> CC:  address@hidden
> Eli Zaretskii wrote:
> >> Date: Wed, 11 Oct 2006 22:32:24 +0200
> >> From: Lennart Borgman <address@hidden>
> >>
> >> Should arguments to 
> >> start-process-shell-command/call-process-shell-command that are file 
> >> names be quoted with shell-quote-arguments?
> >>     
> >
> > Can you show examples of situations when this is an issue?
> >   
> Something like this:
>     (call-process-shell-command "ls" nil t nil "c:/program files/emacs")

I believe it's wrong for call-process-shell-command to quote
arguments, because it has no idea of their semantics.  The doc string
of call-process-shell-command says:

  Remaining arguments are strings passed as additional arguments for COMMAND.

There's no requirement here that each one of the "&rest ARGS" be a
separate command-line argument, is there?  For example, I just tried

  (call-process-shell-command "ls" nil t nil "foo* bar*")

and got a listing of all files that match the two wildcards `foo*' and

So I think that any quoting should be done by the caller of
call-process-shell-command, since only the caller knows what each
argument means.

reply via email to

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