Hard to prove a negative, but I bet committing this doesn't produce warnings about chdir() to a nonexistent or empty-named directory.

Seems like this commit helps.