From: Kenneth Doyle Newsgroups: comp.os.msdos.djgpp Subject: Re: "Command line too long" Date: Mon, 25 Dec 2000 20:49:32 +1100 Organization: CodeCutter Lines: 64 Message-ID: <3A47182B.939851A5@notmail.com> References: NNTP-Posting-Host: p116-tnt1.syd.ihug.com.au Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: bugstomper.ihug.com.au 977740364 27451 203.173.128.116 (25 Dec 2000 10:32:44 GMT) X-Mailer: Mozilla 4.75 [en] (Win95; U) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Eli Zaretskii wrote: > On Mon, 25 Dec 2000, Kenneth Doyle wrote: [snip] > > > There is no such thing as ``the DOS environment''. The environment > block which you manipulate by using the /E: switch to COMMAND.COM is > COMMAND.COM's environment. When a DJGPP program is invoked, it gets > its own environment block, which is a copy of the one from > COMMAND.COM. The DJGPP program's startup code then copies all the > environment variables into the program's memory address space (so that > getenv works without expensive copies from conventional memory). When > a DJGPP program invokes another program, it uses a 16KB block in > conventional memory, the transfer buffer, to construct an environment > block for the child program, by copying all the environment variables > defined at that point to the transfer buffer. Thus, the size of the > transfer buffer is what limits the maximum size of the environment > passed to child programs. > > > But hang on, if the variables are set in AUTOEXEC.BAT, wouldnt they > > also be in the DOS environment? They certainly show up in a DOS box > > when I type "set". > > Yes. But I don't understand what does this have to do with the > original issue (which was inability of RHIDE to pass long command > lines because of a large environment). > > > No, but wait, if that was the problem, then the > > result would show up long before running anything in DJGPP.... > > Sorry, I don't understand what this sentence means. Ah, I'm not sure I do either... I guess it comes down to one of two possibilities. If too many environment variables are (attemptedly) set in command.com. Either some would be truncated, or something would be overwritten (analogous with overwriting a c array). So, if the variables are being truncated in comman.com, they would'nt make it into the DJGPP environment. On the other hand, if something was being overwritten, you would get problems with DOS long before running a DJGPP prog.