From e846a825fedd5e042199d4caf67d1e7145528a0d Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Wed, 14 Feb 2001 23:36:23 +0000 Subject: 13478: whence shouldn't segfault on an empty path component --- ChangeLog | 4 ++++ Src/builtin.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 89c7c03b2..69b3918c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2001-02-14 Clint Adams + + * 13478: Src/builtins.c: don't call dyncat with a NULL argument. + 2001-02-14 Peter Stephenson * 13473: Makefile.in, Doc/Zsh/options.yo: small changes suggested diff --git a/Src/builtin.c b/Src/builtin.c index 8a33a5312..e73a7a452 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -2468,14 +2468,14 @@ bin_whence(char *nam, char **argv, char *ops, int func) /* Option -a is to search the entire path, * * rather than just looking for one match. */ if (all) { - char **pp, *buf, *z; + char **pp, *buf; pushheap(); for (pp = path; *pp; pp++) { if (**pp) { - z = dyncat(*pp, "/"); - } else z = NULL; - buf = dyncat(z, *argv); + buf = zhtricat(*pp, "/", *argv); + } else buf = ztrdup(*argv); + if (iscom(buf)) { if (wd) { printf("%s: command\n", *argv); -- cgit 1.4.1