delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/09/05/12:49:29

Message-Id: <199909051618.QAA77158@out1.ibm.net>
From: "Mark E." <snowball3 AT bigfoot DOT com>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>, djgpp-workers AT delorie DOT com
Date: Sun, 5 Sep 1999 12:17:59 -0400
MIME-Version: 1.0
Subject: Re: Win 9X style long command lines
References: <199909050447 DOT EAA74932 AT out5 DOT ibm DOT net>
In-reply-to: <Pine.SUN.3.91.990905152954.20300V-100000@is>
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 <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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019