diff --git a/wc/wc.rs b/wc/wc.rs index 76f21b1a4..a6b91774b 100644 --- a/wc/wc.rs +++ b/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