patch 9.2.0154: if_lua: runtime error with lua 5.5

Commit: 
https://github.com/vim/vim/commit/e88e360a51f248a49b6c5ce85f5a109cb59c1c32
Author: Christian Brabandt <[email protected]>
Date:   Fri Mar 13 19:21:43 2026 +0000

    patch 9.2.0154: if_lua: runtime error with lua 5.5
    
    Problem:  Lua 5.5 makes for-loop control variables read-only.
              The path-parsing logic in if_lua.c attempts to modify the
              loop variable 's', causing the script to fail during
              runtime initialization (Binbin Qian)
    Solution: Use a Lua capture group in gmatch() to extract the path
              without the semicolon, avoiding the need to re-assign
              to the loop variable.
    
    fixes:  #19639
    closes: #19658
    
    supported by AI
    
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/if_lua.c b/src/if_lua.c
index 364256161..7321af268 100644
--- a/src/if_lua.c
+++ b/src/if_lua.c
@@ -2431,8 +2431,7 @@ luaV_pushversion(lua_State *L)
     "    -- Note: ignores trailing item without trailing `;`. Not using 
something
"\
     "    -- simpler in order to preserve empty items (stand for default path).
"\
     "    local orig = {}
"\
-    "    for s in orig_str:gmatch('[^;]*;') do
"\
-    "      s = s:sub(1, -2)  -- Strip trailing semicolon
"\
+    "    for s in orig_str:gmatch('([^;]*);') do
"\
     "      orig[#orig + 1] = s
"\
     "    end
"\
     "    if key == 'path' then
"\
diff --git a/src/version.c b/src/version.c
index 184a7d327..ae999c903 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    154,
 /**/
     153,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1w18D2-003pSv-N1%40256bit.org.

Raspunde prin e-mail lui