Fix infinite loop when encountering \r in a string