On Wed, Jul 30, 2025, at 4:52 AM, Michal Sojka wrote:
> Description:
>         When running "cd ''", bash 5.3 fails with "cd: null directory"
>         while previous versions succeeded without an error and no
>         directory was changed. I'm not sure whether this is considered a
>         bug or not.

It is not a bug.


>         The SUS[1] says "If directory is an empty string,
>         the results are unspecified.".
>
>         [...]
>
>         [1]: 
> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/cd.html

This was changed in POSIX.1-2024:

        If _directory_ is an empty string, _cd_ shall write
        a diagnostic message to standard error and exit with
        non-zero status.

https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/utilities/cd.html#tag_20_14_05

https://www.austingroupbugs.net/view.php?id=1047


>         However, I didn't find anything
>         related to this change in the NEWS file for bash-5.3.

https://cgit.git.savannah.gnu.org/cgit/bash.git/tree/ChangeLog?h=bash-5.3#n9121


-- 
vq

Reply via email to