Initialize PWD early on (don't expect it to be inherited from the

environment or set it only when changing directories with cd).

PR:	standards/92640
This commit is contained in:
Jens Schweikhardt 2006-02-04 14:47:19 +00:00
parent bbb2cc80aa
commit 81b2ed3edb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=155304

View File

@ -155,6 +155,8 @@ main(int argc, char *argv[])
procargs(argc, argv);
if (getpwd() == NULL && iflag)
out2str("sh: cannot determine working directory\n");
if (getpwd() != NULL)
setvar ("PWD", getpwd(), VEXPORT);
if (argv[0] && argv[0][0] == '-') {
state = 1;
read_profile("/etc/profile");