diff -urNb nmap.orig/nse_main.lua nmap.new/nse_main.lua --- nmap.orig/nse_main.lua 2015-02-20 04:27:28.261799000 +0000 +++ nmap.new/nse_main.lua 2015-02-20 14:20:15.093476000 +0000 @@ -321,6 +321,15 @@ end end +-- Get a consistent string representation of a coroutine: lower case hex chars. +local function co_string(co) + local id = match(tostring(co), "thread: (.*)"); + if id:sub(1, 2) == "0x" then + id = id:sub(3); + end + return id:lower(); +end + -- The Script Class, its constructor is Script.new. local Script = {}; -- The Thread Class, its constructor is Script:new_thread. @@ -467,7 +476,7 @@ co = co, env = env, identifier = tostring(co), - info = format("%s M:%s", self.id, match(tostring(co), "0x(.*)")); + info = format("%s M:%s", self.id, co_string(co)); parent = nil, -- placeholder script = self, type = script_type, @@ -485,7 +494,7 @@ args = pack(...), close_handlers = {}, co = co, - info = format("%s W:%s", self.id, match(tostring(co), "0x(.*)")); + info = format("%s W:%s", self.id, co_string(co)); parent = self, worker = true, };