mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
fixed --max-line-length behaviour
This commit is contained in:
parent
5000ad7f39
commit
68e98ae5e0
1 changed files with 3 additions and 1 deletions
4
wc/wc.rs
4
wc/wc.rs
|
@ -140,7 +140,9 @@ pub fn wc(files: ~[~str], matches: &Matches) {
|
|||
}
|
||||
|
||||
if (current_char_count > longest_line_length) {
|
||||
longest_line_length = current_char_count;
|
||||
// we subtract one here because `line.iter().len()` includes the LF
|
||||
// matches GNU 'wc' behaviour
|
||||
longest_line_length = current_char_count - 1;
|
||||
}
|
||||
},
|
||||
_ => break
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue