NetBSD-Bugs archive

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

PR/59565 CVS commit: [netbsd-11] src/bin/sh



The following reply was made to PR standards/59565; it has been noted by GNATS.

From: "Martin Husemann" <martin%netbsd.org@localhost>
To: gnats-bugs%gnats.NetBSD.org@localhost
Cc: 
Subject: PR/59565 CVS commit: [netbsd-11] src/bin/sh
Date: Tue, 2 Sep 2025 17:48:16 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Tue Sep  2 17:48:16 UTC 2025
 
 Modified Files:
 	src/bin/sh [netbsd-11]: cd.c
 
 Log Message:
 Pull up following revision(s) (requested by kre in ticket #24):
 
 	bin/sh/cd.c: revision 1.54
 	bin/sh/cd.c: revision 1.55
 	bin/sh/cd.c: revision 1.56
 
 PR standards/59565 - cd "" is now an error, not == cd .
 
 POSIX 2024 requires that cd "" generate an error message,
 and fail.
 
 Until now shells (including this one) have typically equated
 it to "cd ." as in the distant past, a lookup of "" as a path
 name would return the current directory (aka ".").
 
 From now on, we generate an error, as specified.
 (For this commit, the error message is kind of pathetic,
 but it is at least there - that will be fixed in a
 subsequent commit.)
 
 Improve error messages from cd builtin
 
 Have cd indicate (particularly for when CDPATH is in use,
 but also in other cases) which path name was attempted
 and failed, and why it failed.   For CDPATH uses, when
 (if) the cd eventually fails, prefer the first entry in
 which the requested destination path is located (when
 the chdir() to it fails), or if there is none of those,
 the first lookup which failed to determine if the path
 exists there or not (ie: not ENOENT).
 
 If the all attempts return ENOENT simply report the arg
 given (after "cd -" and "cd a b" processing), as no
 one CDPATH entry is more appropriate than any other.
 
 Inspired by PR standards/59565 but not directly related.
 
 PR bin/59602  PWD update failure message from cd fix.
 Only complain about being unable to determine the new
 directory name after a cd when -e is given (test for
 that was forgotten).
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.53 -r1.53.6.1 src/bin/sh/cd.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.
 


Home | Main Index | Thread Index | Old Index