summaryrefslogtreecommitdiff
path: root/Build/source/libs/lua53/TLpatches/patch-01-utf-8
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/lua53/TLpatches/patch-01-utf-8')
-rw-r--r--Build/source/libs/lua53/TLpatches/patch-01-utf-817
1 files changed, 17 insertions, 0 deletions
diff --git a/Build/source/libs/lua53/TLpatches/patch-01-utf-8 b/Build/source/libs/lua53/TLpatches/patch-01-utf-8
new file mode 100644
index 00000000000..f2ac4013430
--- /dev/null
+++ b/Build/source/libs/lua53/TLpatches/patch-01-utf-8
@@ -0,0 +1,17 @@
+diff -ur lua-5.3.4.orig/src/lctype.h lua-5.3.4/src/lctype.h
+--- lctype.h.orig 2017-10-24 15:14:50.724139638 +0200
++++ lctype.h 2017-10-24 15:15:51.704137138 +0200
+@@ -53,9 +53,11 @@
+
+ /*
+ ** 'lalpha' (Lua alphabetic) and 'lalnum' (Lua alphanumeric) both include '_'
++**
++** all utf-8 chars (greater than 0x7f) are always alphabetic
+ */
+-#define lislalpha(c) testprop(c, MASK(ALPHABIT))
+-#define lislalnum(c) testprop(c, (MASK(ALPHABIT) | MASK(DIGITBIT)))
++#define lislalpha(c) (isalpha(c) || (c) == '_' || (c) > 0x7f)
++#define lislalnum(c) (isalnum(c) || (c) == '_' || (c) > 0x7f)
+ #define lisdigit(c) testprop(c, MASK(DIGITBIT))
+ #define lisspace(c) testprop(c, MASK(SPACEBIT))
+ #define lisprint(c) testprop(c, MASK(PRINTBIT))