NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/59602: sh produced unwanted diagnostic



On 2025-08-18 1:20 pm, Martin Husemann via gnats wrote:
The following reply was made to PR bin/59602; it has been noted by GNATS.

From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: bin/59602: sh produced unwanted diagnostic
Date: Mon, 18 Aug 2025 19:18:42 +0200

 On Mon, Aug 18, 2025 at 04:55:01PM +0000, christos%zoulas.com@localhost wrote:
 > 	Pax tests are failing with:
 > 	cd: Unable to determine new working directory

 I am not sure this behaviour is better or worse than before (or if it
 should be restricted to interactive mode).

 However, I made the pax tests ignore stderr earlier today, so they are
 not failing any more (the diagnostic output is unrelated to the issues
 tested).

Well, it is also inconsistent: sh -c '{ cd foo; }' does not complain.
No other shell complains about changing directory. The error is more
confusing for me; did the operation succeed or did it fail (it succeeded). And if the shell was smarter, it could avoid doing a full getcwd() in that case because it can still stat("foo") and stat("foo/bar") and determine that they are both directories and append the right path to $PWD for example (I am not suggesting to do this, but I don't see why we need to do getcwd() for chdir()).


christos

--
christos


Home | Main Index | Thread Index | Old Index