handle empty cwd (bsd)