0001-End-OSC8-hyperlink-on-invalid-embedded-escape-sequence.patch 874 B

123456789101112131415161718192021222324252627
  1. From a78e1351113cef564d790a730d657a321624d79c Mon Sep 17 00:00:00 2001
  2. From: Mark Nudelman <markn@greenwoodsoftware.com>
  3. Date: Fri, 7 Oct 2022 19:25:46 -0700
  4. Subject: [PATCH] End OSC8 hyperlink on invalid embedded escape sequence.
  5. [Retrieved from:
  6. https://github.com/gwsw/less/commit/a78e1351113cef564d790a730d657a321624d79c]
  7. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  8. ---
  9. line.c | 4 ++--
  10. 1 file changed, 2 insertions(+), 2 deletions(-)
  11. diff --git a/line.c b/line.c
  12. index 236c49ae..cba7bdd1 100644
  13. --- a/line.c
  14. +++ b/line.c
  15. @@ -633,8 +633,8 @@ ansi_step(pansi, ch)
  16. /* Hyperlink ends with \7 or ESC-backslash. */
  17. if (ch == '\7')
  18. return ANSI_END;
  19. - if (pansi->prev_esc && ch == '\\')
  20. - return ANSI_END;
  21. + if (pansi->prev_esc)
  22. + return (ch == '\\') ? ANSI_END : ANSI_ERR;
  23. pansi->prev_esc = (ch == ESC);
  24. return ANSI_MID;
  25. }