delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/09/24/07:30:43

Date: Mon, 24 Sep 2001 14:28:27 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Andrew Cottrell <acottrel AT ihug DOT com DOT au>
cc: djgpp-workers AT delorie DOT com
Subject: Re: which crashes
In-Reply-To: <007401c144e3$0fad86e0$0a02a8c0@acceleron>
Message-ID: <Pine.SUN.3.91.1010924141908.26299C-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 24 Sep 2001, Andrew Cottrell wrote:

> Just spotted this in the djgpp newsgroup. What about the full_path = at line
> 199? It looks like this line also has the same problem.

No, line 199 belongs to a loop which indeed walks the exts[] array.  The 
next loop, the one where `which' crashed, doesn't walk exts[] but instead 
chops the value of the WHICH  environment variable into individual 
extensions, whereby a pointer to each individual extension is in turn put 
into the ext variable.  The bug was due to cut-and-paste between these 
two loops: the buggy line was referencing exts[indx], which would bomb 
because the value of indx was left from the previous loop, and therefore 
was outside the valid limits for the exts[] array.

> I checked out the differences between Which 2.11 and 2.12 and the changes
> are with the man pages only. I couldn't see who produced the DJGPP port as
> it has allot of DJGPP changes compared to the original which.c source.

I have a few more complaints about the ported Which.  For example, 
there's no DJGPP-specific README anywhere in sight, and it looks like a 
user is supposed to run "sh ./configure" to configure the package.  These 
things shouldn't be left without saying them explicitly.

> The next time I build the Which package for testing under WIn 2K should I
> include these changes?

I don't see any sense in producing a binary that is known to bomb...

> I can also produce a source package as well.

Any binary distribution should be accompanied by a source distribution.  
If you produce the binary from modified sources, you should make those 
modified sources available as well.  That's a GPL requirement.

- Raw text -


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