bug-bash
[Top][All Lists]
Advanced

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

Re: cd: null directory


From: microsuxx
Subject: Re: cd: null directory
Date: Wed, 30 Jul 2025 19:29:21 +0200

old stories , ..

On Wed, Jul 30, 2025, 7:25 PM Stan Marsh <gazelle@xmission.com> wrote:

>
> >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.
>
> It is actually kind of funny that it ever worked the other way (and that
> it still does
> in "other shells") - given that it is the same error internally.  I.e., at
> the C
> level:
>
>     chdir("/NoSuchDir");
> and
>     chdir("");
>
> generate the same error condition.
>
> I wonder why "" was previously special-cased.
>
>
> =================================================================================
> Please do not send me replies to my posts on the list.
> I always read the replies via the web archive, so CC'ing to me is
> unnecessary.
>
> Note that they always end up in my Spam file anyway, so it is annoying
> to have to periodically clean that out.
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]