Skip to content

Commit

Permalink
End OSC8 hyperlink on invalid embedded escape sequence.
Browse files Browse the repository at this point in the history
  • Loading branch information
gwsw committed Oct 8, 2022
1 parent dc4fa8c commit a78e135
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions line.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,8 +633,8 @@ ansi_step(pansi, ch)
/* Hyperlink ends with \7 or ESC-backslash. */
if (ch == '\7')
return ANSI_END;
if (pansi->prev_esc && ch == '\\')
return ANSI_END;
if (pansi->prev_esc)
return (ch == '\\') ? ANSI_END : ANSI_ERR;
pansi->prev_esc = (ch == ESC);
return ANSI_MID;
}
Expand Down

0 comments on commit a78e135

Please sign in to comment.