summaryrefslogtreecommitdiff
path: root/cd.c
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@x1-nano.kaivo.local>2023-04-01 22:52:46 -0400
committerJakob Kaivo <jkk@x1-nano.kaivo.local>2023-04-01 22:52:46 -0400
commitcd9c1108e2ced618c25245352ce57f2b3c668379 (patch)
tree8fd3b84dd7870a4ac81b3bd5f2302b40b9eee683 /cd.c
parent23e9c66180b95e5b1ba03ae739c04ebefa183e05 (diff)
fix cd so that PWD is always an absolute path
Diffstat (limited to 'cd.c')
-rw-r--r--cd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/cd.c b/cd.c
index a494901..8b0a663 100644
--- a/cd.c
+++ b/cd.c
@@ -132,6 +132,7 @@ int cd_main(int argc, char *argv[])
return 1;
}
+ getcwd(curpath, sizeof(curpath));
setenv("OLDPWD", oldpath, 1);
setenv("PWD", curpath, 1);
return 0;