substr can return false when path=''