Re: [AD] 3.9.34 release date?

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


In message <3A5CE273.F04703A1@xxxxxxxxxx>, Bob writes:
>Olly Betts wrote:
>[snip] 
>> Incidentally, wouldn't it be safer to declare argv to have 129 entries
>> rather than 64?  129 is the most a 256 character command line can possibly
>> generate
>
>The DOS/Windows command line is only 127 (128?) bytes long, including
>carriage return and line feed. So Allegro is correct on that one.

Is that just a limitation of the command prompt, or does it apply to
programs invoked by "Run" from the start menu or a file association?  If so
for the latter, then you wouldn't be able to load a file with a pathname
greater than about 120 characters into notepad.  The docs for CreateProcess
don't mention any limit on command line length.

Also the GetCommandLine documentation on MSDN notes:

  The name of the executable in the command line that the operating system
  provides to a process is not necessarily identical to that in the command
  line that the calling process gives to the CreateProcess function. The
  operating system may prepend a fully qualified path to an executable name
  that is provided without a fully qualified path.

This suggests that the command line returned can be longer than that used to
create the process.

>However, I've noticed that Windows 2000 does NOT have this limitation on
>win32 programs! More specifically, MSVC can be passed arbitrarily long
>commands through the command prompt. I'm not sure we can do anything
>about that though.

We can cope with arbitrary length command lines with arbitrary numbers of
arguments if we use malloc.  I'll have a go at it when I'm a bit less busy.

Cheers,
Olly



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/