Skip to content
Snippets Groups Projects
Commit 0dce2f07 authored by rswindell's avatar rswindell
Browse files

Don't treat a blank line returned from readln() as the end of input.

parent 6354424b
No related branches found
No related tags found
No related merge requests found
......@@ -84,7 +84,7 @@ if(join) {
if(msg)
send(msg);
else while(msg=readln()) /* read from stdin */
else while((msg=readln())!=undefined) /* read from stdin */
send(msg);
while(my_server.poll(0) && (response=my_server.recvline()))
......@@ -96,23 +96,16 @@ exit();
function send(msg)
{
sendit=true;
if(msg==undefined || msg.search(/^[\r\n]*$/)!=-1) {
log("Not sending blank message");
sendit=false;
}
for(i in exclude) {
if(msg.search(exclude[i])>=0) {
log("Excluding: " + msg);
sendit=false;
}
}
if(sendit) {
log("Sending: " + msg);
if(!my_server.send("PRIVMSG "+channel+" :"+expand_tabs(msg)+"\r\n"))
alert("send failure");
return;
}
for(i in exclude)
if(msg.search(exclude[i])>=0)
return;
log("Sending: " + msg);
if(!my_server.send("PRIVMSG "+channel+" :"+expand_tabs(msg)+"\r\n"))
alert("send failure");
}
function expand_tabs(msg)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment