If neither is set, chdir does nothing. It returns true on success, false otherwise; So .... if it's supposed to do nothing, and successfully does nothing, shouldn't it then return true ?
Seems to me
AppleFritter has correctly identified that, under those conditions, chdir() returns false - but it's not spelled out very clearly in the documentation.
I think the documentation would be better written as:
"If neither is set, chdir does nothing and returns false. Otherwise it returns true on success, or false on failure"
Cheers,
Rob