Mystery of escaping a while loop?

What is the code supposed to do?