[FarGroup/FarManager] master: Fix a corner case in regex search (8a93d293f)

0 views
Skip to first unread message

farg...@farmanager.com

unread,
Dec 26, 2025, 8:01:28 PM (10 hours ago) Dec 26
to farco...@googlegroups.com
Repository : https://github.com/FarGroup/FarManager
On branch : master
Link : https://github.com/FarGroup/FarManager/commit/8a93d293fb37e5f2ef5e6e6139a49429bd682019

>---------------------------------------------------------------

commit 8a93d293fb37e5f2ef5e6e6139a49429bd682019
Author: Alex Alabuzhev <alab...@gmail.com>
Date: Sat Dec 27 00:54:14 2025 +0000

Fix a corner case in regex search


>---------------------------------------------------------------

8a93d293fb37e5f2ef5e6e6139a49429bd682019
far/changelog | 7 ++++++-
far/strmix.cpp | 2 +-
far/vbuild.m4 | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/far/changelog b/far/changelog
index 4765f09a8..c318a8ef6 100644
--- a/far/changelog
+++ b/far/changelog
@@ -1,10 +1,15 @@
+--------------------------------------------------------------------------------
+drkns 2025-12-27 00:52:23+00:00 - build 6620
+
+1. Fix a corner case in regex search.
+
--------------------------------------------------------------------------------
drkns 2025-12-26 10:40:12+00:00 - build 6619

1. Fix block undo in Editor.

2. Fix empty string replace in Editor.
- Expetimental. Also M2467.
+ Experimental. Also M2467.

--------------------------------------------------------------------------------
shmuel 2025-12-21 21:59:27+02:00 - build 6618
diff --git a/far/strmix.cpp b/far/strmix.cpp
index f50b57b0a..354d5c3e9 100644
--- a/far/strmix.cpp
+++ b/far/strmix.cpp
@@ -1240,7 +1240,7 @@ bool SearchAndReplaceString(
if (options.Regex)
{
// Empty Haystack is ok for regex search, e.g. ^$
- if ((Position || HaystackSize) && Position >= HaystackSize)
+ if (Position > HaystackSize)
return false;

return SearchStringRegex(Haystack, re, Match, Position, options, ReplaceStr, CurPos, SearchLength, WordDiv);
diff --git a/far/vbuild.m4 b/far/vbuild.m4
index fcb133468..42f64ebd7 100644
--- a/far/vbuild.m4
+++ b/far/vbuild.m4
@@ -1 +1 @@
-6619
+6620


Reply all
Reply to author
Forward
0 new messages