auxdisplay: charlcd: fix x/y command parsing

The x/y command parsing has been broken since commit 129957069e6a
("staging: panel: Fixed checkpatch warning about simple_strtoul()").

Commit b34050fadb86 ("auxdisplay: charlcd: Fix and clean up handling of
x/y commands") fixed some problems by rewriting the parsing code,
but also broke things further by removing the check for a complete
command before attempting to parse it. As a result, parsing is
terminated at the first x or y character.

This reinstates the check for a final semicolon. Whereas the original
code use strchr(), this is wasteful seeing as the semicolon is always
at the end of the buffer. Thus check this character directly instead.

Signed-off-by: Mans Rullgard <mans@mansr.com>
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>

authored by Mans Rullgard and committed by Miguel Ojeda 9bc30ab8 40e020c1

Changed files
+3
drivers
auxdisplay
+3
drivers/auxdisplay/charlcd.c
··· 538 538 } 539 539 case 'x': /* gotoxy : LxXXX[yYYY]; */ 540 540 case 'y': /* gotoxy : LyYYY[xXXX]; */ 541 + if (priv->esc_seq.buf[priv->esc_seq.len - 1] != ';') 542 + break; 543 + 541 544 /* If the command is valid, move to the new address */ 542 545 if (parse_xy(esc, &priv->addr.x, &priv->addr.y)) 543 546 charlcd_gotoxy(lcd);