aboutsummaryrefslogtreecommitdiff
path: root/advtrains/nodedb.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2021-05-07 10:19:49 +0200
committerorwell96 <orwell@bleipb.de>2021-05-07 10:19:49 +0200
commite506086011ee24a30d3085c6933e8e38f2abd325 (patch)
tree626a1f85679f7ac1b14d04b3dfcdaf8250c7e826 /advtrains/nodedb.lua
parent81cd305aa04f7af0bd812c5addb8673d5d633b44 (diff)
downloadadvtrains-e506086011ee24a30d3085c6933e8e38f2abd325.tar.gz
advtrains-e506086011ee24a30d3085c6933e8e38f2abd325.tar.bz2
advtrains-e506086011ee24a30d3085c6933e8e38f2abd325.zip
Serialization: strip trailing \r also in nodedb callbackrelease-2.3.1
Diffstat (limited to 'advtrains/nodedb.lua')
-rw-r--r--advtrains/nodedb.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/advtrains/nodedb.lua b/advtrains/nodedb.lua
index c664792..36b5dea 100644
--- a/advtrains/nodedb.lua
+++ b/advtrains/nodedb.lua
@@ -116,6 +116,8 @@ function ndb.load_callback(file)
local stid_byte = file:read(2)
local stid = bytes_to_int(stid_byte)
local stna = file:read("*l")
+ -- possibly windows fix: strip trailing \r's from line
+ stna = string.gsub(stna, "\r$", "")
--atdebug("content id:", stid, "->", stna)
ndb_nodeids[stid] = stna
end