Date: Tue, 13 Apr 1999 13:31:53 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Hans-Bernhard Broeker cc: djgpp-workers AT delorie DOT com Subject: Re: LBInstDJ In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Tue, 13 Apr 1999, Hans-Bernhard Broeker wrote: > > set OLDPATH=%PATH% > > set PATH=C:\DJGPP\BIN;%PATH% > > if not "%PATH%"=="C:\DJGPP\BIN;%OLDPATH%" echo ERROR > > Unless my knowledge on command.com is completely failing me, here, this > will not work at all. A 'filled close to overflowing' PATH variable is one > that is almost as long as the DOS command line lenght limit (around 127 > chars). That's right, the above is for the case that the environment is full, not PATH itself. Sorry for a misleading message. One way to detect the next-to-full PATH would by to call `system'. Hmm, now that I think about this, maybe calling `system' to run AUTOEXEC.BAT, and then examining the results in the environment *is* the way to deal with many of the complexities which were mentioned in this thread? (Just remember to set the bit in __system_flags that causes it to always invoke COMMAND.COM, or, even better, call COMMAND.COM explicitly: ret = system ("command.com /c cfgcheck.bat"); where cfgcheck.bat is something like this: @echo off call C:\autoexec.bat set > envlist.txt Then examine envlist.txt to know what does autoexec.bat do. For example, a problem with a full PATH might be detected if its length is exactly 126 characters, or if it ends with a `;'. You can even simulate a given environment by setting CONFIG to it before running autoexec.bat.