Repository :
https://github.com/FarGroup/FarManager
On branch : master
Link :
https://github.com/FarGroup/FarManager/commit/62b6e87f9d6340eafd4720aee035014ff095b1ec
>---------------------------------------------------------------
commit 62b6e87f9d6340eafd4720aee035014ff095b1ec
Author: Shmuel Zeigerman <
solo...@gmail.com>
Date: Fri Dec 5 18:46:26 2025 +0200
LuaFAR (regex): fix a corner case
>---------------------------------------------------------------
62b6e87f9d6340eafd4720aee035014ff095b1ec
plugins/luamacro/_globalinfo.lua | 2 +-
plugins/luamacro/changelog | 4 ++++
plugins/luamacro/luafar/lf_regex.c | 9 ++++-----
plugins/luamacro/luafar/lf_version.h | 2 +-
4 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/plugins/luamacro/_globalinfo.lua b/plugins/luamacro/_globalinfo.lua
index 5ac302f6d..d6b518245 100644
--- a/plugins/luamacro/_globalinfo.lua
+++ b/plugins/luamacro/_globalinfo.lua
@@ -1,6 +1,6 @@
function export.GetGlobalInfo()
return {
- Version = { 3, 0, 0, 908 },
+ Version = { 3, 0, 0, 909 },
MinFarVersion = { 3, 0, 0, 6564 },
Guid = win.Uuid("4EBBEFC8-2084-4B7F-94C0-692CE136894D"),
Title = "LuaMacro",
diff --git a/plugins/luamacro/changelog b/plugins/luamacro/changelog
index 0762e8ce9..a50d6861b 100644
--- a/plugins/luamacro/changelog
+++ b/plugins/luamacro/changelog
@@ -1,3 +1,7 @@
+shmuel 2025-12-05 18:44:38+02:00 - build 909
+
+1. LuaFAR (regex): fix a corner case.
+
shmuel 2025-11-23 12:04:52+02:00 - build 908
1. Correct the previous commit.
diff --git a/plugins/luamacro/luafar/lf_regex.c b/plugins/luamacro/luafar/lf_regex.c
index 59dcc95cc..905782afc 100644
--- a/plugins/luamacro/luafar/lf_regex.c
+++ b/plugins/luamacro/luafar/lf_regex.c
@@ -220,11 +220,10 @@ int rx_find_match(lua_State *L, int Op, int is_function, int is_wide)
data.Length = len;
data.Position = luaL_optinteger(L, 3, 1);
- if (data.Position > 0 && --data.Position > data.Length)
- data.Position = data.Length;
-
- if (data.Position < 0 && (data.Position += data.Length) < 0)
- data.Position = 0;
+ if (data.Position > 0)
+ data.Position--;
+ else if (data.Position < 0)
+ data.Position += data.Length;
data.Count = RegExpControl(fr->hnd, RECTL_BRACKETSCOUNT, 0, 0);
data.Match = (struct RegExpMatch*)lua_newuserdata(L, data.Count*sizeof(struct RegExpMatch));
diff --git a/plugins/luamacro/luafar/lf_version.h b/plugins/luamacro/luafar/lf_version.h
index 7af055591..52f39142c 100644
--- a/plugins/luamacro/luafar/lf_version.h
+++ b/plugins/luamacro/luafar/lf_version.h
@@ -1,3 +1,3 @@
#include <farversion.hpp>
-#define PLUGIN_BUILD 908
+#define PLUGIN_BUILD 909