summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
m---------core/src/tbox/tbox0
-rw-r--r--core/src/xmake/utf8/width.c6
-rw-r--r--core/xmake.lua2
-rwxr-xr-xcore/xmake.sh2
4 files changed, 7 insertions, 3 deletions
diff --git a/core/src/tbox/tbox b/core/src/tbox/tbox
-Subproject 14f9089e1e4a9b8b01f5789f4c5d6a04e6652b3
+Subproject 3330978dce512b5c7104683383a40ab2b14be73
diff --git a/core/src/xmake/utf8/width.c b/core/src/xmake/utf8/width.c
index 615572462..fb79ee198 100644
--- a/core/src/xmake/utf8/width.c
+++ b/core/src/xmake/utf8/width.c
@@ -33,7 +33,11 @@
* utf8.width(codepoint)
*/
tb_int_t xm_utf8_width(lua_State* lua) {
- if (lua_isnumber(lua, 1)) {
+ /* we must not use lua_isnumber() here: it also accepts a numeric string,
+ * so utf8.width("9") would return the width of the code point 9 (a tab)
+ * instead of the width of the string "9"
+ */
+ if (lua_type(lua, 1) == LUA_TNUMBER) {
xm_utf8_int_t val = (xm_utf8_int_t)lua_tointeger(lua, 1);
lua_pushinteger(lua, xm_utf8_charwidth(val));
} else {
diff --git a/core/xmake.lua b/core/xmake.lua
index 5eb42cc1c..5536cbf98 100644
--- a/core/xmake.lua
+++ b/core/xmake.lua
@@ -1,7 +1,7 @@
set_project("xmake")
set_xmakever("3.0.5")
set_policy("build.progress_style", "multirow")
-set_version("3.1.0", {build = "%Y%m%d"})
+set_version("3.1.1", {build = "%Y%m%d"})
-- set all warnings as errors
set_warnings("all", "error")
diff --git a/core/xmake.sh b/core/xmake.sh
index 085a3f82b..935a7158b 100755
--- a/core/xmake.sh
+++ b/core/xmake.sh
@@ -1,7 +1,7 @@
#!/bin/sh
set_project "xmake"
-set_version "3.1.0" "%Y%m%d"
+set_version "3.1.1" "%Y%m%d"
# set warning all
set_warnings "all"