Skip to content
Snippets Groups Projects
Unverified Commit 0e681d5c authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-core: util: avoid unintended second return value from gsub()

gsub() returns the number of matches as its second return value. This
was unintendedly passed through by the util functions trim() and
node_id(). It can be presumed that this had no effect in practice, but
it can lead to surprising output when passing values to print() for
debugging.
parent daf8a6c1
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,7 @@ local function do_filter_prefix(input, output, prefix)
end
function M.trim(str)
return str:gsub("^%s*(.-)%s*$", "%1")
return (str:gsub("^%s*(.-)%s*$", "%1"))
end
function M.contains(table, value)
......@@ -96,7 +96,7 @@ function M.exec(command)
end
function M.node_id()
return string.gsub(sysconfig.primary_mac, ':', '')
return (string.gsub(sysconfig.primary_mac, ':', ''))
end
function M.default_hostname()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment