From 780b6963982cb9819af7fd1383dbf9ed68091780 Mon Sep 17 00:00:00 2001 From: Steve AB7PA <69524416+ab7pa@users.noreply.github.com> Date: Tue, 11 May 2021 19:27:05 -0700 Subject: [PATCH] fix: Local Alert File Read All (#102) * fix: Local Alert File Read All Read the entire local_message file rather than just the first line. * fix: Local Alert File Read All Also fix the issue with empty alert files showing empty newui alert dialogs. --- files/usr/lib/lua/aredn/info.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/files/usr/lib/lua/aredn/info.lua b/files/usr/lib/lua/aredn/info.lua index d224e3eb..32ea869a 100755 --- a/files/usr/lib/lua/aredn/info.lua +++ b/files/usr/lib/lua/aredn/info.lua @@ -144,7 +144,9 @@ function model.getArednAlert() afile:close() end end - return alert + if #alert~=0 then return alert + else return "" + end end ------------------------------------- @@ -156,11 +158,13 @@ function model.getLocalAlert() if file_exists(fname) then afile=io.open(fname,"r") if afile~=nil then - alert=afile:read() + alert=afile:read("*a") afile:close() end end - return alert + if #alert~=0 then return alert + else return "" + end end