This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [PATCH] Fix parameter passing containing quote/equal to Windows batch command
- From: Christopher Faylor <cgf-use-the-mailinglist-please at cygwin dot com>
- To: cygwin-patches at cygwin dot com
- Date: Sat, 25 Jan 2014 01:35:03 -0500
- Subject: Re: [PATCH] Fix parameter passing containing quote/equal to Windows batch command
- Authentication-results: sourceware.org; auth=none
- References: <CABDpyCh3VMDmd4Rb64Fz-cb2HzUwtZ0cY9T3xWUC8_O-eqKO6Q at mail dot gmail dot com> <20140124203415 dot GA6857 at ednor dot casa dot cgf dot cx> <CABDpyCg40oJeq=TJxFqidVsuVKRfZycLkK+kCz=Td-QgJafu4g at mail dot gmail dot com>
- Reply-to: cygwin-patches at cygwin dot com
On Fri, Jan 24, 2014 at 03:14:30PM -0800, Daniel Dai wrote:
>Hi, Christopher,
>
>The current logic is: if the parameter contains quote, then put a
>quote around the parameter (winf.cc:78). However, if the quote is in
>the beginning/end, cygwin will still quote it, and thus double quoted
>parameter (such as ""a=b"").
That is as intended. It doesn't matter where the quote is. This is an
argv list. Quotes don't mean anything in a UNIX argv list. They do
need to be quoted for Windows though.
So, if there is a quote at the beginning of argv[7], then the process
should see a quote in argv[7].
If I say pass "\"a=b\"", the subprocess should diligently report "a=b"
quotes and all. That is what it does now after my change.
AFAICT, this is all working as it should.
cgf