shithub: lu9-lua

Download patch

ref: 0bacc8eef49b1f8e43e95578c87f5c020587b765
parent: 5a71c1d2face6d917e5be7987a6942a5d32ffff2
author: kvik <[email protected]>
date: Sat Feb 6 17:56:15 EST 2021

utf8lib: resolve symbol collision with Plan 9 libc

--- a/lutf8lib.c
+++ b/lutf8lib.c
@@ -89,7 +89,7 @@
 ** start in the range [i,j], or nil + current position if 's' is not
 ** well formed in that interval
 */
-static int utflen (lua_State *L) {
+static int _utflen (lua_State *L) {
   lua_Integer n = 0;  /* counter for the number of characters */
   size_t len;  /* string length in bytes */
   const char *s = luaL_checklstring(L, 1, &len);
@@ -272,7 +272,7 @@
   {"offset", byteoffset},
   {"codepoint", codepoint},
   {"char", utfchar},
-  {"len", utflen},
+  {"len", _utflen},
   {"codes", iter_codes},
   /* placeholders */
   {"charpattern", NULL},