mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
Make fn cd safe for rc -e.
This commit is contained in:
parent
915a8b77ff
commit
3f056d8ef2
1 changed files with 10 additions and 3 deletions
13
rcmain
13
rcmain
|
@ -24,9 +24,16 @@ if(! ~ $#cflag 0){
|
||||||
}
|
}
|
||||||
if(flag i){
|
if(flag i){
|
||||||
if(~ $TERM 9term){
|
if(~ $TERM 9term){
|
||||||
if(~ $#'fn#cd' 0)
|
fn cd {
|
||||||
fn cd { builtin cd $1 && flag i && awd }
|
# builtin cd $1 && flag i && awd
|
||||||
awd
|
# is not sufficient when running in a subshell
|
||||||
|
# that is rc -e (like mk uses!)
|
||||||
|
if(builtin cd $1){
|
||||||
|
if(flag i) $PLAN9/bin/9 awd || status=''
|
||||||
|
status=''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$PLAN9/bin/9 awd
|
||||||
}
|
}
|
||||||
if(flag l && test -r $home/lib/profile) . $home/lib/profile
|
if(flag l && test -r $home/lib/profile) . $home/lib/profile
|
||||||
status=''
|
status=''
|
||||||
|
|
Loading…
Reference in a new issue