From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13615 invoked from network); 19 Sep 2000 16:20:00 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 19 Sep 2000 16:19:59 -0000 Received: (qmail 22851 invoked by alias); 19 Sep 2000 16:19:21 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12847 Received: (qmail 22844 invoked from network); 19 Sep 2000 16:19:20 -0000 Date: Tue, 19 Sep 2000 12:19:18 -0400 From: Clint Adams To: zsh-workers@sunsite.auc.dk Subject: PATCH: whence - PATH_MAX Message-ID: <20000919121918.A21542@dman.com> References: <20000917235109.A6793@dman.com> <20000918000915.B6793@dman.com> <1000918063956.ZM24783@candle.brasslantern.com> <20000918132142.B11367@dman.com> <1000919031819.ZM30176@candle.brasslantern.com> <20000919112345.A21076@dman.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.1.2i In-Reply-To: <20000919112345.A21076@dman.com>; from schizo@debian.org on Tue, Sep 19, 2000 at 11:23:45AM -0400 This removes direct dependency on PATH_MAX from Src/builtin.c. Index: Src/builtin.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v retrieving revision 1.35 diff -u -r1.35 builtin.c --- Src/builtin.c 2000/09/18 03:31:32 1.35 +++ Src/builtin.c 2000/09/19 16:15:11 @@ -2390,17 +2390,14 @@ /* Option -a is to search the entire path, * * rather than just looking for one match. */ if (all) { - char **pp, buf[PATH_MAX], *z; + char **pp, *buf, *z; + pushheap(); for (pp = path; *pp; pp++) { - z = buf; if (**pp) { - strucpy(&z, *pp); - *z++ = '/'; - } - if ((z - buf) + strlen(*argv) >= PATH_MAX) - continue; - strcpy(z, *argv); + z = dyncat(*pp, "/"); + } else z = NULL; + buf = dyncat(z, *argv); if (iscom(buf)) { if (wd) { printf("%s: command\n", *argv); @@ -2420,6 +2417,7 @@ puts(wd ? ": none" : " not found"); returnval = 1; } + popheap(); } else if ((cnam = findcmd(*argv, 1))) { /* Found external command. */ if (wd) {