delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/24/13:19:04

Message-Id: <200008241717.MAA11538@darwin.sfbr.org>
Date: Thu, 24 Aug 2000 12:18:24 -0500 (CDT)
From: Jeff Williams <jeffw AT darwin DOT sfbr DOT org>
Subject: Re: DJGPP port of WHICH
To: djgpp AT delorie DOT com
Cc: nobody AT bogus DOT org
MIME-Version: 1.0
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.

- Raw text -


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