Re: Commit: patch 9.1.1222: using wrong length for last inserted string

2025-03-21 Fir de Conversatie shane.qian
> Hi, > > I would argue that: > > - if (insert->length > 0) > - { > - // remove trailing ESC > - --insert->length; > - if (s[insert->length] == ESC) > - s[insert->length] = NUL; > - } > + if (insert.length > 0 && s[insert.length - 1] == ESC) // remove trailing > ESC > + s[insert.length - 1] = NUL

Commit: patch 9.1.1222: using wrong length for last inserted string

2025-03-18 Fir de Conversatie Christian Brabandt
patch 9.1.1222: using wrong length for last inserted string Commit: https://github.com/vim/vim/commit/8ac0f73eb1e0e6128dd21eb294d12b83b615f05a Author: John Marriott Date: Tue Mar 18 20:49:01 2025 +0100 patch 9.1.1222: using wrong length for last inserted string Problem: using wr

Re: Commit: patch 9.1.1222: using wrong length for last inserted string

2025-03-18 Fir de Conversatie Christ van Willegen
Hi, I would argue that: - if (insert->length > 0) - { - // remove trailing ESC - --insert->length; - if (s[insert->length] == ESC) - s[insert->length] = NUL; - } + if (insert.length > 0 && s[insert.length - 1] == ESC) // remove trailing ESC + s[insert.length - 1] = NUL; return s; still does