Skip to content
Myr

Fix segmentation fault on \x1b[0K

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fix #2339

authored by Junegunn Choi · committed by Junegunn Choi · parent a0649ed · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:src/ansi.go+1 added-1 removed
199 unmodified lines
200 } else {201 state = &ansiState{prevState.fg, prevState.bg, prevState.attr, prevState.lbg}202 }203 if ansiCode[0] != '\x1b' || ansiCode[1] != '[' || ansiCode[len(ansiCode)-1] != 'm' {204 if strings.HasSuffix(ansiCode, "0K") {204 if strings.HasSuffix(ansiCode, "0K") && prevState != nil {205 state.lbg = prevState.bg206 }207 return state208 }
88 unmodified lines