zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <schizo@debian.org>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: whence - PATH_MAX
Date: Tue, 19 Sep 2000 12:19:18 -0400	[thread overview]
Message-ID: <20000919121918.A21542@dman.com> (raw)
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) {


      reply	other threads:[~2000-09-19 16:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-18  3:51 PATCH: PATH_MAX and mailstat, part I Clint Adams
2000-09-18  4:09 ` PATCH: PATH_MAX and mailstat, part II Clint Adams
2000-09-18  6:39   ` PATCH: Redo a couple of PATH_MAX changes Bart Schaefer
2000-09-18 17:21     ` PATCH: bin_ln - PATH_MAX Clint Adams
2000-09-19  3:18       ` Bart Schaefer
2000-09-19 15:23         ` PATCH: files module " Clint Adams
2000-09-19 16:19           ` Clint Adams [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20000919121918.A21542@dman.com \
    --to=schizo@debian.org \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).