[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
PR/45390 CVS commit: [netbsd-9] src/bin/sh
The following reply was made to PR bin/45390; it has been noted by GNATS.
From: "Martin Husemann" <martin%netbsd.org@localhost>
Subject: PR/45390 CVS commit: [netbsd-9] src/bin/sh
Date: Sat, 6 Nov 2021 13:42:18 +0000
Module Name: src
Committed By: martin
Date: Sat Nov 6 13:42:18 UTC 2021
src/bin/sh [netbsd-9]: cd.c sh.1
Pull up following revision(s) (requested by kre in ticket #1372):
bin/sh/sh.1: revision 1.236 (patch)
bin/sh/cd.c: revision 1.51
PR bin/45390 - fix for folly four
In the pwd builtin, verify that curdir names '.' before
simply printing it. Never alter PWD or OLDPWD in the
Also while here, implement the (new: coming in POSIX, but has existed
for a while in several other shells) -e option to cd (with -e, cd -P
will exit(1) if the chdir() succeeds, but PWD cannot be discovered).
cd now prints the directory name used (if different from that given,
or cdprint is on) if interactive or (the new bit)in posix mode.
Some additional/changed comments added, and a DEBUG mode trace call
that was accidentally put inside an #if 0 block moved to where it
can do some good.
XXX pullup -9
Be explicit about what happens to PWD after a successful cd command.
Also be very clear that "cd" and "cd -P" are the same thing, and
the only cd variant implemented.
Also, when it is appropriate to print the new directory after a cd
command, note that it happens if interactive (as it always has here)
and also if the posix option is set (for POSIX compat, where "interactive"
is irrelevant). Mention that "cd -" is a case where the new directory
is printed (along with paths relative to a non-empty CDPATH entry,
and where the "cd old new" (string replacement in curdir) is used.
While here document the new -e option to cd.
XXX pullup -9
To generate a diff of this commit:
cvs rdiff -u -r1.50 -r126.96.36.199 src/bin/sh/cd.c
cvs rdiff -u -r188.8.131.52 -r184.108.40.206 src/bin/sh/sh.1
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Main Index |
Thread Index |