tk/Third-fix-proposal-for-4b555aca34-text-search-all-ha.patch
2019-09-30 11:18:32 -04:00

29 lines
943 B
Diff

From c42964a52a7dbb003356da456afc992b9eecb377 Mon Sep 17 00:00:00 2001
From: fvogel <fvogelnew1@free.fr>
Date: Mon, 15 Oct 2018 18:58:49 +0000
Subject: [PATCH 357/693] Third fix proposal for [4b555aca34]: text search -all
hangs and eats all memory. (And fix test text-22.229)
---
generic/tkText.c | 3 ++-
tests/text.test | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/generic/tkText.c b/generic/tkText.c
index e49693edc..7dfd0483d 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -6090,7 +6090,8 @@ SearchCore(
alreadySearchOffset -= matchLength;
}
} else {
- firstOffset = p - startOfLine + matchLength;
+ firstOffset = (matchLength == 0) ? p - startOfLine + 1
+ : p - startOfLine + matchLength;
if (firstOffset >= lastOffset) {
/*
* Now, we have to be careful not to find
--
2.19.1