[Top][All Lists]

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

Re: Fixing Windows and DOS command line argument quoting

From: Eli Zaretskii
Subject: Re: Fixing Windows and DOS command line argument quoting
Date: Mon, 25 Apr 2011 21:47:08 +0300

> Date: Mon, 25 Apr 2011 10:56:07 -0700
> From: Daniel Colascione <address@hidden>
> Cc: address@hidden
> After another reading of cmdproxy.c, I also see that the CreateProcess
> path also doesn't expand environment %variable% references, and that
> doesn't fall back to cmd if the command to be executed contains them.
> While we could expand these variables, doing so would move us even
> closer to reimplementing half of cmd.exe.

We don't want to reimplement cmd.exe, that's for sure.  I would say,
if it's easy to detect that case, just make that another condition for
going through the shell.  If it isn't easy to detect, we can always
say that these commands must be explicitly run through "cmd /c" by the
application.  After all, that's not a frequent use case in Emacs,
because Emacs always expands environment variables before running the
command, and if it doesn't, it surely won't use the %foo% syntax.  So
about the only use case for this is a Lisp application that directly
targets Windows -- and those could be told to go through cmd

> I'd like to remove this path in the trunk and see whether the new
> 8192-character length limitation is a problem in practice.

No, I don't think it's a good idea.  8K is too low by any measure; we
already hit the shell limitations once or twice when related problems
were discussed.

What are the disadvantages of detecting quoted command lines and
sending only those through the shell?

reply via email to

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