From 1986da812f05d57d47c404a6b3841f94bebcd258 Mon Sep 17 00:00:00 2001 From: Rob Swindell <rob@synchro.net> Date: Wed, 13 Jan 2021 20:44:17 -0800 Subject: [PATCH] strip_ctrl() now returns null (not "null") when passed null This script had some funky work-arounds for the previous behavior, so adjust them to recognize null input from the user. This fixes issue #201 reported by Ragnarok. --- exec/postit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exec/postit.js b/exec/postit.js index 35c0aa65ad..e97d18afef 100644 --- a/exec/postit.js +++ b/exec/postit.js @@ -304,14 +304,14 @@ function MessageList(root,name,ext) while(!this.file.eof) { var text=strip_ctrl(this.file.readln()); - if(text=="null") break; + if(text=="null" || !text) break; var author=text.substring(0,text.indexOf("@")); var date=text.substr(text.indexOf("@")+1); var message=[]; while(!this.file.eof) { var temp=this.file.readln(); - if(strip_ctrl(temp)=="null" || strip_ctrl(temp)=="") break; + if(!temp || strip_ctrl(temp)=="null" || strip_ctrl(temp)=="") break; message.push(temp); } this.array.push(new Post(author,date,message)); -- GitLab