diff options
author | Clint Adams <clint@users.sourceforge.net> | 2001-02-14 23:36:23 +0000 |
---|---|---|
committer | Clint Adams <clint@users.sourceforge.net> | 2001-02-14 23:36:23 +0000 |
commit | e846a825fedd5e042199d4caf67d1e7145528a0d (patch) | |
tree | fd6efd8454b1c84e746b750c28c3863c1e86f05f | |
parent | 53a7b0c44575552a997c1f09a5f4ea13d80fe965 (diff) | |
download | zsh-e846a825fedd5e042199d4caf67d1e7145528a0d.tar.gz zsh-e846a825fedd5e042199d4caf67d1e7145528a0d.tar.xz zsh-e846a825fedd5e042199d4caf67d1e7145528a0d.zip |
13478: whence shouldn't segfault on an empty path component
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | 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 <schizo@debian.org> + + * 13478: Src/builtins.c: don't call dyncat with a NULL argument. + 2001-02-14 Peter Stephenson <pws@csr.com> * 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); |