ansi: fix bug that looping in the SkipOne state.