Fix bug in dir_for_path The last checkin accidentally broke dir_for_path by propogating the dirname return code even when there was no error.