Message-Id: <199909051618.QAA77158@out1.ibm.net> From: "Mark E." To: Eli Zaretskii , djgpp-workers AT delorie DOT com Date: Sun, 5 Sep 1999 12:17:59 -0400 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Win 9X style long command lines References: <199909050447 DOT EAA74932 AT out5 DOT ibm DOT net> In-reply-to: X-mailer: Pegasus Mail for Win32 (v3.12a) Reply-To: djgpp-workers AT delorie DOT com > 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 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/