From f4138ecb02ca21b2144f23b6d1cff59f53e2b43e Mon Sep 17 00:00:00 2001 From: schweikh Date: Sat, 4 Feb 2006 14:47:19 +0000 Subject: 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 --- bin/sh/main.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bin') diff --git a/bin/sh/main.c b/bin/sh/main.c index cfdfe9d..5ad69f2 100644 --- a/bin/sh/main.c +++ b/bin/sh/main.c @@ -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"); -- cgit v1.1