On Sun, Oct 22, 2023 at 11:59 AM Bart Schaefer wrote: > > So this reaches the "return NULL" at the end of zgetdir(), after the > comment "Something bad happened." ? > > Or conversely this is a consequence of zgetdir() not checking the > return value from zchdir(), which it doesn't in a couple of places? Lacking a response to this and unable to test this directly, I offer the following patch, which attempts to cover all those cases. I forced HAVE_GETCWD to be false and ran make check with no issues.