This is the mail archive of the
mailing list for the Cygwin project.
RE: Formatting command line arguments when starting a Cygwin process from a native process
- From: "Aaron Digulla" <digulla at hepe dot com>
- To: "David Allsopp" <dra27 at cantab dot net>
- Cc: cygwin at cygwin dot com
- Date: Mon, 09 May 2016 16:57:16 +0200
- Subject: RE: Formatting command line arguments when starting a Cygwin process from a native process
- Authentication-results: sourceware.org; auth=none
Am Samstag, 07. Mai 2016 09:45 CEST, "David Allsopp" <firstname.lastname@example.org> schrieb:
> > Then all you need is a rudimentary quoting.
> Yes, but the question still remains what that rudimentary quoting is - i.e.
> I can see how to quote spaces which appear in elements of argv, but I cannot
> see how to quote double quotes!
This should help: https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/
My line of thought is that Cygwin can't get anything which Windows can't send it. So the first step to solve this mess is to make sure the arguments which you send to CreateProcess() are correct.
The next step would be to write a small C utility which dumps it's arguments, so you can properly debug all kinds of characters.
PS: I always point people to string list/array type methods to create processes which fix all the problems with spaces and odd characters (quotes, umlauts, etc). It seems that Windows doesn't have such a method to create processes. Which kind of makes sense; Windows is very, very mouse centered.
Aaron "Optimizer" Digulla a.k.a. Philmann Dark
"It's not the universe that's limited, it's our imagination.
Follow me and I'll show you something beyond the limits."
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple