fix bug where initial lines were not being written
This commit is contained in:
parent
a70a0828b6
commit
69a5ac4d51
@ -94,7 +94,8 @@ fn try_main() -> Result<(), Box<dyn Error>> {
|
||||
break;
|
||||
}
|
||||
let mut out_file = File::create(format!("{}{}", prefix, suffix))?;
|
||||
for _ in 0..opts.lines {
|
||||
out_file.write_all(line.as_bytes())?;
|
||||
for _ in 1..opts.lines {
|
||||
line.clear();
|
||||
match reader.read_line(&mut line)? {
|
||||
0 => {
|
||||
@ -105,6 +106,7 @@ fn try_main() -> Result<(), Box<dyn Error>> {
|
||||
}
|
||||
};
|
||||
}
|
||||
line.clear();
|
||||
}
|
||||
|
||||
// see if there's anything left for the remainder file
|
||||
|
Loading…
Reference in New Issue
Block a user