git: 1739de97af19 - main - makesyscalls: make strip_abi_prefix more robust

From: Brooks Davis <brooks_at_FreeBSD.org>
Date: Wed, 17 Nov 2021 20:22:02 UTC
The branch main has been updated by brooks:

URL: https://cgit.FreeBSD.org/src/commit/?id=1739de97af19d2eb726becd38758fc7a06dcc6e9

commit 1739de97af19d2eb726becd38758fc7a06dcc6e9
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2021-11-17 20:12:21 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2021-11-17 20:12:21 +0000

    makesyscalls: make strip_abi_prefix more robust
    
    Allow strip_abi_prefix() to be called with nil and return nil in that
    case.  This simplifies handling of RESERVED entries.
    
    Reviewed by:    kevans
---
 sys/tools/makesyscalls.lua | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/tools/makesyscalls.lua b/sys/tools/makesyscalls.lua
index 7824a533e4d5..a390be8b6154 100644
--- a/sys/tools/makesyscalls.lua
+++ b/sys/tools/makesyscalls.lua
@@ -352,6 +352,9 @@ end
 local function strip_abi_prefix(funcname)
 	local abiprefix = config["abi_func_prefix"]
 	local stripped_name
+	if funcname == nil then
+		return nil
+	end
 	if abiprefix ~= "" and funcname:find("^" .. abiprefix) then
 		stripped_name = funcname:gsub("^" .. abiprefix, "")
 	else