From 68e98ae5e0d0375faff31b8e95997f3a78cae451 Mon Sep 17 00:00:00 2001 From: Boden Garman Date: Sat, 30 Nov 2013 12:57:15 +1100 Subject: [PATCH] fixed --max-line-length behaviour --- wc/wc.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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