From 9b4ce2dbe2353cbbfe98f2819d0f3074d54e6b55 Mon Sep 17 00:00:00 2001

From: =?UTF-8?q?Jaakko=20Ker=C3=A4nen?= jaakko.keranen@iki.fi

Date: Fri, 30 Jul 2021 08:29:31 +0300

Subject: [PATCH 1/1] InputWidget: Fixed undefined behavior when inserting a

newline


src/ui/inputwidget.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c

index c9779ff0..50b12d1f 100644

--- a/src/ui/inputwidget.c

+++ b/src/ui/inputwidget.c

@@ -969,11 +969,11 @@ static void textOfLinesWasChanged_InputWidget_(iInputWidget *d, iRangei lineRang

static void insertRange_InputWidget_(iInputWidget *d, iRangecc range) {

 iRangecc nextRange = { range.end, range.end };

 const int firstModified = d->cursor.y;

     /* If there's a newline, we'll need to break and begin a new line. */

     const char *newline = iStrStrN(range.start, "\n", size_Range(&range));

     if (newline) {

         range.end = newline;

     }

     iInputLine *line = cursorLine_InputWidget_(d);

--

2.25.1

Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/dev/patch/9b4ce2dbe2353cbbfe98f2819d0f3074d54e6b55.patch
Status Code
Success (20)
Meta
text/plain
Capsule Response Time
29.642485 milliseconds
Gemini-to-HTML Time
0.670677 milliseconds

This content has been proxied by September (ba2dc).