From c5c95b22834809a5ad2fef6ec86c9f6900cc2714 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sat, 7 May 2022 12:39:56 +0100 Subject: ash: don't set OLDPWD on startup Commit f9b753e70 (ash: set current working directory on startup) set the current working directory of an interactive, non-login shell during startup to ensure drives mapped to a network share and symlinks were reported correctly. It had the side effect of setting OLDPWD. This is unnecessary because the current working directory won't have changed. (GitHub issue #253) --- shell/ash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'shell') diff --git a/shell/ash.c b/shell/ash.c index f42dc49c3..c2c1f2098 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -15774,7 +15774,8 @@ int ash_main(int argc UNUSED_PARAM, char **argv) else if (!login_sh && iflag) { char *cwd = getcwd(NULL, 0); if (cwd) { - docd(cwd, 0); + chdir(cwd); + setpwd(NULL, 0); free(cwd); } } -- cgit v1.2.3-55-g6feb