mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-11-20 12:40:55 +01:00
52999: import OLDPWD from environment if set
This commit is contained in:
parent
09c5b10dc2
commit
0bb140f991
2 changed files with 10 additions and 1 deletions
|
|
@ -1,3 +1,8 @@
|
||||||
|
2024-07-28 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||||
|
|
||||||
|
* 52999: Franklin Yu (adapted): Src/init.c: Import OLDPWD from
|
||||||
|
the environment if set.
|
||||||
|
|
||||||
2024-07-04 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
|
2024-07-04 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
|
||||||
|
|
||||||
* 52985: Src/exec.c: avoid adding original param to restorelist
|
* 52985: Src/exec.c: avoid adding original param to restorelist
|
||||||
|
|
|
||||||
|
|
@ -1245,7 +1245,11 @@ setupvals(char *cmd, char *runscript, char *zsh_name)
|
||||||
pwd = metafy(zgetcwd(), -1, META_DUP);
|
pwd = metafy(zgetcwd(), -1, META_DUP);
|
||||||
}
|
}
|
||||||
|
|
||||||
oldpwd = ztrdup(pwd); /* initialize `OLDPWD' = `PWD' */
|
oldpwd = zgetenv("OLDPWD");
|
||||||
|
if (oldpwd == NULL)
|
||||||
|
oldpwd = ztrdup(pwd); /* initialize `OLDPWD' = `PWD' */
|
||||||
|
else
|
||||||
|
oldpwd = ztrdup(oldpwd);
|
||||||
|
|
||||||
inittyptab(); /* initialize the ztypes table */
|
inittyptab(); /* initialize the ztypes table */
|
||||||
initlextabs(); /* initialize lexing tables */
|
initlextabs(); /* initialize lexing tables */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue