Closed mzz2017 closed 2 years ago
bufio.ScanLines scans lines using \r?\n by default, which prevents us from reading the output of some programs from a pipe, such as mtr.
bufio.ScanLines
\r?\n
mtr
Because these programs use \r for newlines, we can use strace to know that.
\r
strace
This PR fixed it by using \r?\n|\r\n? to check the newline.
\r?\n|\r\n?
To reproduce it, try:
mtr 223.5.5.5 --curses | nali
Thanks co-debuggers @chinggg @cubercsl .
I have read those issues and fixed the format problem.
Thank you, I have test it, it works well with mtr.
bufio.ScanLines
scans lines using\r?\n
by default, which prevents us from reading the output of some programs from a pipe, such asmtr
.Because these programs use
\r
for newlines, we can usestrace
to know that.This PR fixed it by using
\r?\n|\r\n?
to check the newline.To reproduce it, try:
Thanks co-debuggers @chinggg @cubercsl .