diff options
author | dchagin <dchagin@FreeBSD.org> | 2017-04-15 11:13:11 +0000 |
---|---|---|
committer | dchagin <dchagin@FreeBSD.org> | 2017-04-15 11:13:11 +0000 |
commit | 9878fb1e0f314058f4c30cc4c77722f00e17188a (patch) | |
tree | 2f0dd759511c9fea5ee93d228684a99622ed5e8e /contrib/tcsh/sh.exec.c | |
parent | 21382a2b98c257da842adc1f651f3e207dd235af (diff) | |
download | FreeBSD-src-9878fb1e0f314058f4c30cc4c77722f00e17188a.zip FreeBSD-src-9878fb1e0f314058f4c30cc4c77722f00e17188a.tar.gz |
MFC r315948:
Update tcsh to 6.20.00
MFC r315952:
Update tcsh to vendor git b605cb561d
Vendor changes:
1. PR/471: Daiki Ueno: Delay interpreting arginp until we've processed
our startup files (which can change the NLS environment).
2. Fix type of read in prompt confirmation (eg. rmstar) (David Kaspar).
3. Fix out of bounds read (Brooks Davis)
(reproduce by starting tcsh and hitting tab at the prompt).
4. Don't play pointer tricks that are undefined in modern c
(Brooks Davis).
Diffstat (limited to 'contrib/tcsh/sh.exec.c')
-rw-r--r-- | contrib/tcsh/sh.exec.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/contrib/tcsh/sh.exec.c b/contrib/tcsh/sh.exec.c index 2b41a53..bb0fa48 100644 --- a/contrib/tcsh/sh.exec.c +++ b/contrib/tcsh/sh.exec.c @@ -1,4 +1,4 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/sh.exec.c,v 3.79 2011/02/25 23:58:34 christos Exp $ */ +/* $Header: /p/tcsh/cvsroot/tcsh/sh.exec.c,v 3.81 2016/09/12 16:33:54 christos Exp $ */ /* * sh.exec.c: Search, find, and execute a command! */ @@ -32,7 +32,7 @@ */ #include "sh.h" -RCSID("$tcsh: sh.exec.c,v 3.79 2011/02/25 23:58:34 christos Exp $") +RCSID("$tcsh: sh.exec.c,v 3.81 2016/09/12 16:33:54 christos Exp $") #include "tc.h" #include "tw.h" @@ -606,9 +606,10 @@ execash(Char **t, struct command *kp) cleanup_push(&state, execash_cleanup); /* - * Decrement the shell level + * Decrement the shell level, if not in a subshell */ - shlvl(-1); + if (mainpid == getpid()) + shlvl(-1); #ifdef WINNT_NATIVE __nt_really_exec=1; #endif /* WINNT_NATIVE */ @@ -1070,6 +1071,9 @@ dowhere(Char **v, struct command *c) { int found = 1; USE(c); + + if (adrof(STRautorehash)) + dohash(NULL, NULL); for (v++; *v; v++) found &= find_cmd(*v, 1); /* Make status nonzero if any command is not found. */ @@ -1166,7 +1170,11 @@ retry: return rval; } } - if (adrof(STRautorehash) && !rehashed && havhash) { + /* + * If we are printing, we are being called from dowhere() which it + * has rehashed already + */ + if (!prt && adrof(STRautorehash) && !rehashed && havhash) { dohash(NULL, NULL); rehashed = 1; goto retry; |