correctly detect an empty grep