Skip to content

Commit

Permalink
prevent spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
schollz committed Jan 8, 2022
1 parent 2aa86bb commit d01cdd1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/mod.lua
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ m.key=function(n,z)
do return end
end
print("new station: "..x)
state.station=x
state.station=x:gsub("%s+","")
local f=io.open(_path.data.."broadcast/station","w")
f:write(x)
f:write(state.station)
io.close(f)
if state.is_running then
m.toggle_station(true)
Expand Down Expand Up @@ -173,6 +173,7 @@ m.init=function()
f:close()
if content~=nil then
state.station=(content:gsub("^%s*(.-)%s*$","%1"))
state.station=state.station:gsub("%s+","")
end
end
end
Expand Down

0 comments on commit d01cdd1

Please sign in to comment.