Issue with run.exe and PWD with spaces since last update (Cygwin 1.7.21)

Charles Wilson cygwin@cwilson.fastmail.fm
Wed Jul 17 14:54:00 GMT 2013


On 7/17/2013 10:10 AM, Corinna Vinschen wrote:
> Uhm.  In that case, if ew *really* think your tools are the only
> affected ones, Why do we bother to fix libcmain.c?  Can't you then
> simply provide your own main() in case of building for Cygwin?

Perhaps, but I'm not sure of the ramifications. I think if you have a 
main() then you're going to get STD_HANDLES. Plus there's the whole 
concern about launching run[2].exe itself without a cmdbox, when it is 
used as a shortcut target.

This whole entrypoint thing is tied up in that, or at least it used to 
be.  Now, that may ONLY apply to the mingw[64]-compiled version, in 
which case I could do a

#ifdef __CYGWIN__
int main (int argc, char** argv)
{
    return realmain(argc, argv);
}
#endif
and avoid the -e WinMain@16 link argument. (Except I think I arrange to 
only do -e WinMain@16 on mingw...hmm...)

If you look closely at WinMain, it basically parses the result from 
GetCommandLine() into argc,argv, and then delegates. The only 
conceivable reason to do that, rather than just have a main(), was if 
you NEED to use WinMain() as the entry point for some other reason. Like 
ensuring that you "work" when compiled as a non-console app and don't 
pop up a dosbox...

--
Chuck


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list