delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/26/14:12:52

From: "Tim 'Zastai' Van Holder" <zastai AT hotmail DOT com>
Newsgroups: comp.os.msdos.djgpp
References: <200008241717 DOT MAA11538 AT darwin DOT sfbr DOT org>
Subject: Re: DJGPP port of WHICH
Lines: 29
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Message-ID: <xdTp5.66654$Ee.560389@afrodite.telenet-ops.be>
Date: Sat, 26 Aug 2000 17:35:25 GMT
NNTP-Posting-Host: 213.224.93.160
X-Trace: afrodite.telenet-ops.be 967311325 213.224.93.160 (Sat, 26 Aug 2000 19:35:25 MET DST)
NNTP-Posting-Date: Sat, 26 Aug 2000 19:35:25 MET DST
Organization: Pandora - Met vlotte tred op Internet
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Jeff Williams" <jeffw AT darwin DOT sfbr DOT org> wrote in message
news:200008241717 DOT MAA11538 AT darwin DOT sfbr DOT org...
> -: > 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.
It probably would; the point is this would not easily integrate in
GNU which. And since there already is a GNu tool that does what
we want on Unix, and with very little effort can be made to do it
on DOS too, it seems a waste to write a whole new program.


Tim Van Holder


- Raw text -


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