while (button == BUTTON_SELECT){} checks if the test is true, then if it's true, executes the body (which is empty), then checks if the test is true, then if it's true, executes the body.... et cetera. When the test is just a variable equal to something, it always stays the same*, so this is an infinite loop.
* unless the variable is changed by another thread or a signal handler or an ISR and is declared volatile.