Mail Archives: djgpp-workers/1999/09/05/12:49:29
> I think we need some way of detecting whether the invoked program
> supports the $CMDLINE method. How about extending _check_v2_prog (sp?)
> so that it also recognizes a PE executable? (4DOS and its ilk could
> be recognized by their names.)
I can handle detecting PE executables, but I don't enough about 4DOS to handle that case.
Perhaps someone who does could help out here.
> Please also note that it might be a good idea to support this feature
> in `system' where it checks for the command line being too long (see
> the _shell_command function)--there we *know* it's the shell that gets
> invoked.
>
Here's one of my sample programs I've been using:
#include <stdlib.h>
int main()
{
system ("ENV.EXE one two three four five six seven eight nine ten eleven twelve
thirteen fourteen fifteen sixteen seventeen eighteen nineteen twenty twentyone twentytwo
\"twentythree twentyfour\" twentyfive");
return 0;
}
So you're saying system ("command.com /c env.exe one two three ...
also needs to be handled? If not, please correct the example.
> The quoting would need some special testing. The quoted arguments
> support in Windows programs is an undocumented mess full of
> incompatibilities. Perhaps we should DTRT at least for Cygwin- and
> Mingw-compiled programs.
Right.
>
> As a matter of fact, building some package with Cygwin or Mingw tools
> invoked with DJGPP Make built with this patch would be a good test
> case.
>
Interesting you bring this up. The reason I decided to give this a go is to have the
ability to use DJGPP Make with Mingw32. Mingw32's Make has a peculiararity that can make
it difficult to use, but right now DJGPP's Make is out of the question because of the
long cmd line incompatibility.
> > ! arglist = parse_bytes(cmdline, strlen(cmdline),
> > ! (_crt0_startup_flags & _CRT0_FLAG_KEEP_QUOTES) == 0);
> > ! }
> > ! else
> > ! {
> > ! abort();
> > ! }
>
> Isn't it better to fall back on the usual DOS command-line tail
> instead of abort()'ing?
>
It is better. But it wanted to have something to test that worked before starting on
refinements.
---
Mark Elbrecht, snowball3 AT bigfoot DOT com
http://snowball.frogspace.net/
- Raw text -