delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/04/13/06:34:07

Date: Tue, 13 Apr 1999 13:31:53 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
cc: djgpp-workers AT delorie DOT com
Subject: Re: LBInstDJ
In-Reply-To: <Pine.LNX.3.93.990413114359.3378A-100000@acp3bf>
Message-ID: <Pine.SUN.3.91.990413131957.12434B-100000@is>
MIME-Version: 1.0
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

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.

- Raw text -


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