This is the mail archive of the
mailing list for the Cygwin project.
Re: cygwin passes argv with preserved (") quote. and it is undesired result.
- From: Csaba Raduly <rcsaba at gmail dot com>
- To: cygwin at cygwin dot com, jojelino at gmail dot com
- Date: Thu, 31 Dec 2009 15:42:37 +0200
- Subject: Re: cygwin passes argv with preserved (") quote. and it is undesired result.
- References: <email@example.com>
On Thu, Dec 31, 2009 at 10:00 AM, jojelino wrote:
> here is testcase to reproduce the problem
> #include <stdio.h>
> #include <assert.h>
> int main(int argc, char**argv)
> printf("argv %s",argv);
> return 0;
> make け.txt in directory.
> and run in cmd.exe
> a "け.txt"
> and it complains file can't be opened.
> and you can see argv is passed with preserved quote (") although it is
> invoked in winshell
> it must be eliminted when it is transduced to cygwin environment.
> but when parent process is cygwin, it gives no complaint
>>strace a "け.txt"
> in result, is it designed to do so?
Yes. "parent process is cygwin" probably means that a.exe was started
from bash. The quote character is special for bash; see for example
This means that when started from bash, a.exe gets what's inside the
quotes, without the quotes themselves. cmd.exe may behave differently.
Hope this helps,
Life is complex, with real and imaginary parts
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple