Message-Id: <200008241717.MAA11538@darwin.sfbr.org> Date: Thu, 24 Aug 2000 12:18:24 -0500 (CDT) From: Jeff Williams Subject: Re: DJGPP port of WHICH To: djgpp AT delorie DOT com Cc: nobody AT bogus DOT org MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: WPoY7GTW5P5XJucrBZJheQ== X-Mailer: dtmail 1.3.0 @(#)CDE Version 1.3.4 SunOS 5.7 sun4u sparc Reply-To: djgpp AT delorie DOT com -: > I played around with the __dosexec_find_on_path function, but it -: > would require major changes to the original "which.c" source code -: > to support the "-a" switch. Would something like this work? Call __dosexec_find_on_path with a local copy of the environment variable PATH; if non NULL, retrieve and display the result from *buf; replace the local copy of the path string with the substring starting at the end of the path for the command just found; call __dosexec_find_on_path again with the substring; continue subsetting your local path string until __dosexec... returns NULL.