Handle files with only whitespace correctly