mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 10:37:23 -07:00
fix: bizarr behavior in Proxspace lua, where io.read("*l") default behavior swaps to io.read("*L") . So lets make *L default a strip away all newlines...
This commit is contained in:
parent
0c25f85c9f
commit
dc4bd2c1f7
1 changed files with 7 additions and 7 deletions
|
@ -20,17 +20,17 @@ local Utils =
|
|||
end,
|
||||
---
|
||||
-- Asks the user for input
|
||||
input = function (message , default)
|
||||
local answer
|
||||
input = function (message, default)
|
||||
local answer = ''
|
||||
if default ~= nil then
|
||||
message = message .. " (default: ".. default.. " )"
|
||||
end
|
||||
message = message .." \n > "
|
||||
io.write(message)
|
||||
io.write(message, "\n > ")
|
||||
io.flush()
|
||||
answer = io.read()
|
||||
if answer == '' then answer = default end
|
||||
|
||||
answer = io.read("*L")
|
||||
answer = string.gsub(answer, "\r\n", "")
|
||||
answer = string.gsub(answer, "\n", "")
|
||||
if answer == '' or answer == nil then answer = default end
|
||||
return answer
|
||||
end,
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue