On 15/12/2018 1:27 AM, Paul Eggert wrote:
+ if (stat (dir + prefix_len, &st) == 0 + && S_ISDIR (st.st_mode))That patch doesn't look quite right, since it can use errno even when stat succeeded (in which case errno contains garbage).
Oops, you're right, that doesn't make any sense, keeping more checks than the syscall one in the condition is wrong. My bad.
I installed the attached instead; please give it a try.
That looks good. I've also tried it with coreutils and it works as expected. Thanks!