diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2018-09-29 14:13:20 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2018-09-29 14:13:20 +0000 |
commit | 9a546e75bff746133b95b1266374f6c92b7fd276 (patch) | |
tree | 7a7ff27ed4d1b89332b03d3de43acaf5aa410e17 | |
parent | 7b24697b6f18bb41a5507183995215294a27fd4a (diff) |
Export the PWD and OLDPWD shell variables as per POSIX.
Previously, these would only be exported if they were present
in the environment when the shell started. OK deraadt@ anton@ kn@
-rw-r--r-- | bin/ksh/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/ksh/main.c b/bin/ksh/main.c index 3380d85badb..0c5282cf161 100644 --- a/bin/ksh/main.c +++ b/bin/ksh/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.92 2018/05/18 13:25:20 benno Exp $ */ +/* $OpenBSD: main.c,v 1.93 2018/09/29 14:13:19 millert Exp $ */ /* * startup, main loop, environments and error handling @@ -81,7 +81,7 @@ static const char initsubs[] = "${PS2=> } ${PS3=#? } ${PS4=+ }"; static const char *initcoms [] = { "typeset", "-r", "KSH_VERSION", NULL, - "typeset", "-x", "SHELL", "PATH", "HOME", NULL, + "typeset", "-x", "SHELL", "PATH", "HOME", "PWD", "OLDPWD", NULL, "typeset", "-ir", "PPID", NULL, "typeset", "-i", "OPTIND=1", NULL, "eval", "typeset -i RANDOM MAILCHECK=\"${MAILCHECK-600}\" SECONDS=\"${SECONDS-0}\" TMOUT=\"${TMOUT-0}\"", NULL, |