From f8a58dbcb14a66edc72f883ea5a0c6fa8afd0343 Mon Sep 17 00:00:00 2001 From: Merith-TK Date: Thu, 22 Apr 2021 11:54:56 -0700 Subject: [PATCH] Fixed length check on function name in `expect` (#589) --- patchwork.md | 6 ++++++ .../data/computercraft/lua/rom/modules/main/cc/expect.lua | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/patchwork.md b/patchwork.md index 08274e447..8e621ce2b 100644 --- a/patchwork.md +++ b/patchwork.md @@ -356,3 +356,9 @@ fff8353451451be5ae31e0f63d8e529b127fd186 Remove extra space (#586) ``` + +``` +486f41f08286ddcfad91d72b83a9361bd9c215cb + +Fixed length check on function name in `expect` (#589) +``` diff --git a/src/main/resources/data/computercraft/lua/rom/modules/main/cc/expect.lua b/src/main/resources/data/computercraft/lua/rom/modules/main/cc/expect.lua index 397be085e..6be4e135d 100644 --- a/src/main/resources/data/computercraft/lua/rom/modules/main/cc/expect.lua +++ b/src/main/resources/data/computercraft/lua/rom/modules/main/cc/expect.lua @@ -53,7 +53,7 @@ local function expect(index, value, ...) local name if native_type(debug) == "table" and native_type(debug.getinfo) == "function" then local ok, info = pcall(debug.getinfo, 3, "nS") - if ok and info.name and #info.name ~= "" and info.what ~= "C" then name = info.name end + if ok and info.name and info.name ~= "" and info.what ~= "C" then name = info.name end end local type_names = get_type_names(...)