From 91d12dbb8c7ba0a155241bd056b1702b8e6fee72 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Tue, 5 Apr 2016 20:43:21 -0400 Subject: Import Lua UTF-8 pattern functions directly into `utf8` library from C. --- src/lutf8libext.patch | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/lutf8libext.patch') diff --git a/src/lutf8libext.patch b/src/lutf8libext.patch index ab881928..5dd975ce 100644 --- a/src/lutf8libext.patch +++ b/src/lutf8libext.patch @@ -123,12 +123,17 @@ ENTRY(find), ENTRY(gmatch), ENTRY(gsub), -@@ -1301,11 +1319,13 @@ - luaL_newlib(L, libs); +@@ -1297,15 +1315,17 @@ + { NULL, NULL } + }; + ++lua_getglobal(L, "utf8"); + #if LUA_VERSION_NUM >= 502 +- luaL_newlib(L, libs); ++ luaL_setfuncs(L, libs, 0); #else - lua_createtable(L, 0, sizeof(libs)/sizeof(libs[0])); -- luaL_register(L, NULL, libs); -+ luaL_register(L, "utf8_ext", libs); +- lua_createtable(L, 0, sizeof(libs)/sizeof(libs[0])); + luaL_register(L, NULL, libs); #endif +#if 0 -- cgit v1.2.3