diff options
author | ache <ache@FreeBSD.org> | 1995-06-18 14:20:16 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1995-06-18 14:20:16 +0000 |
commit | 4ceec448202671b9cf3e226f494b9d514e71b1df (patch) | |
tree | 710cf6a1a69d9b92771d4f1918d6747a8e54c7a1 /bin | |
parent | b47fb59bab0f70484bde1d04274af8a9a06a0dea (diff) | |
download | FreeBSD-src-4ceec448202671b9cf3e226f494b9d514e71b1df.zip FreeBSD-src-4ceec448202671b9cf3e226f494b9d514e71b1df.tar.gz |
Fix error:
which /bin/ls
.//bin/ls
Obtained from: NetBSD
Diffstat (limited to 'bin')
-rw-r--r-- | bin/csh/exec.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/bin/csh/exec.c b/bin/csh/exec.c index 5a444f3..d775073 100644 --- a/bin/csh/exec.c +++ b/bin/csh/exec.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: exec.c,v 1.2 1994/09/24 02:53:59 davidg Exp $ + * $Id: exec.c,v 1.3 1995/05/30 00:06:32 rgrimes Exp $ */ #ifndef lint @@ -656,7 +656,7 @@ tellmewhat(lex) register struct biltins *bptr; register struct wordent *sp = lex->next; bool aliased = 0; - Char *s0, *s1, *s2; + Char *s0, *s1, *s2, *cmd; Char qc; if (adrof1(sp->word, &aliases)) { @@ -703,6 +703,8 @@ tellmewhat(lex) } } + sp->word = cmd = globone(sp->word, G_IGNORE); + if ((i = iscommand(strip(sp->word))) != 0) { register Char **pv; register struct varent *v; @@ -717,10 +719,14 @@ tellmewhat(lex) while (--i) pv++; if (pv[0][0] == 0 || eq(pv[0], STRdot)) { - sp->word = Strspl(STRdotsl, sp->word); - prlex(cshout, lex); - xfree((ptr_t) sp->word); + if (!slash) { + sp->word = Strspl(STRdotsl, sp->word); + prlex(cshout, lex); + xfree((ptr_t) sp->word); + } else + prlex(cshout, lex); sp->word = s0; /* we save and then restore this */ + xfree((ptr_t) cmd); return; } s1 = Strspl(*pv, STRslash); @@ -734,5 +740,6 @@ tellmewhat(lex) prlex(cshout, lex); (void) fprintf(csherr, "%s: Command not found.\n", vis_str(sp->word)); } + xfree((ptr_t) cmd); sp->word = s0; /* we save and then restore this */ } |