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 "-".
This commit is contained in:
Joseph Crail 2015-08-14 00:10:15 -04:00
parent 04014d314c
commit 26f0ec8379

View file

@ -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) {