Re: Unexpected behavior of ${x#word} and ${x/pat/str} in the case command

2025-06-26 Thread Chet Ramey
On 6/23/25 5:02 AM, Takaaki Konno wrote: Bash Version: 5.1 Patch Level: 4 Release Status: release Description: Parameters expanded to null by pattern removal or pattern substitution in the patterns of case clauses produced unexpected results in some cases. The version of bash in my system is

Re: variable replacement text differences

2025-06-26 Thread Chet Ramey
On 6/19/25 7:16 PM, Jeff Ketchum wrote: I think that helps me understand the differences better, and what I am seeing. Though It doesn't seem like it is completely consistent, and not what I expected when using a variable with specific layout. (and also breaking change enabled by default) examp

Re: getcwd() returns with stale errno value upon error

2025-06-26 Thread Chet Ramey
On 6/25/25 3:44 AM, Richard Weinberger wrote: Bash Version: 5.2 Patch Level: 37 Release Status: release Description: getcwd() as implemented in lib/sh/getcwd.c can return with NULL and a stale errno value if the algorithm fails. It aborts if readdir() returns NULL and

Re: getcwd() returns with stale errno value upon error

2025-06-26 Thread Oğuz
On Thursday, June 26, 2025, Martin D Kealey wrote: > There's a fairly obvious race condition where another process replaces a > directory entry That's not the case here. between readlink and lstat. Who said anything about them? > I would like bash to cope more gracefully with "unexpected"

Re: getcwd() returns with stale errno value upon error

2025-06-26 Thread Martin D Kealey
On Thu, 26 Jun 2025 at 04:07, Oğuz wrote: > On Wednesday, June 25, 2025, Richard Weinberger > wrote: > > > > This can happen on filesystems where d_ino != st_ino > > i.e. a broken filesystem. Or not broken. There's a fairly obvious race condition where another process replaces a direc