Skip to content
Snippets Groups Projects
Commit 6c74f984 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Trim all control chars off the ends of lines

This solves the problem of detecting a Synchronet (for OS/2) BBS at
telnet://wyseguybbs.mywire.org:2300

That system responds with some control characters (NULs and ^Cs)
before the initial welcome banner, so just strip those out.
parent 78f63dec
No related branches found
No related tags found
1 merge request!455Update branch with changes from master
......@@ -120,7 +120,7 @@ function capture()
lines.length = 0;
curline="";
} else if(char=='\n') {
if(curline.length && curline.charAt(curline.length-1)=='\r')
while(curline.length && curline.charCodeAt(curline.length-1) < ascii(' '))
curline = curline.substring(0,curline.length-1);
lines.push(curline);
log(LOG_DEBUG, format("Captured %u lines (last: %u bytes)", lines.length, curline.length));
......
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