From 26f0ec8379121b652aeb227efc4d4348bb28a5ba Mon Sep 17 00:00:00 2001 From: Joseph Crail Date: Fri, 14 Aug 2015 00:10:15 -0400 Subject: [PATCH] Fix difference w/ GNU coreutils' sum. When using the SYSV algorithm and reading from standard input, the GNU coreutils implementation does not output the filename, in this case "-". --- src/sum/sum.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sum/sum.rs b/src/sum/sum.rs index cf8a5efa1..75f25adee 100644 --- a/src/sum/sum.rs +++ b/src/sum/sum.rs @@ -112,7 +112,11 @@ Checksum and count the blocks in a file.", NAME, VERSION); matches.free }; - let print_names = sysv || files.len() > 1; + let print_names = if sysv { + files.len() > 1 || files[0] != "-" + } else { + files.len() > 1 + }; for file in files.iter() { let reader = match open(file) {