mirror of
https://github.com/uutils/coreutils
synced 2024-11-15 17:28:03 +00:00
comm: clear buffers between read_line calls
This commit is contained in:
parent
14b1313eaf
commit
8a6768e9bd
1 changed files with 4 additions and 0 deletions
|
@ -86,6 +86,7 @@ fn comm(a: &mut LineReader, b: &mut LineReader, opts: &getopts::Matches) {
|
|||
ensure_nl(ra);
|
||||
print!("{}{}", delim[1], ra);
|
||||
}
|
||||
ra.clear();
|
||||
na = a.read_line(ra);
|
||||
},
|
||||
Ordering::Greater => {
|
||||
|
@ -93,6 +94,7 @@ fn comm(a: &mut LineReader, b: &mut LineReader, opts: &getopts::Matches) {
|
|||
ensure_nl(rb);
|
||||
print!("{}{}", delim[2], rb);
|
||||
}
|
||||
rb.clear();
|
||||
nb = b.read_line(rb);
|
||||
},
|
||||
Ordering::Equal => {
|
||||
|
@ -100,6 +102,8 @@ fn comm(a: &mut LineReader, b: &mut LineReader, opts: &getopts::Matches) {
|
|||
ensure_nl(ra);
|
||||
print!("{}{}", delim[3], ra);
|
||||
}
|
||||
ra.clear();
|
||||
rb.clear();
|
||||
na = a.read_line(ra);
|
||||
nb = b.read_line(rb);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue