mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
od: remove trailing spaces in output
can't find documentation confirming this behaviour besides it does not work correctly on all formats see also uutils/coreutils#922
This commit is contained in:
parent
f45169d37c
commit
1b01f02e9e
2 changed files with 6 additions and 14 deletions
|
@ -213,7 +213,6 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
const LINEBYTES:usize = 16;
|
const LINEBYTES:usize = 16;
|
||||||
const WORDBYTES:usize = 2;
|
|
||||||
|
|
||||||
fn odfunc(input_offset_base: &Radix, fnames: &[InputSource], formats: &[OdFormat]) -> i32 {
|
fn odfunc(input_offset_base: &Radix, fnames: &[InputSource], formats: &[OdFormat]) -> i32 {
|
||||||
|
|
||||||
|
@ -288,13 +287,6 @@ fn odfunc(input_offset_base: &Radix, fnames: &[InputSource], formats: &[OdFormat
|
||||||
}
|
}
|
||||||
b = nextb;
|
b = nextb;
|
||||||
}
|
}
|
||||||
// Add extra spaces to pad out the short, presumably last, line.
|
|
||||||
if n < LINEBYTES {
|
|
||||||
// calc # of items we did not print, must be short at least WORDBYTES to be missing any.
|
|
||||||
let words_short = (LINEBYTES - n) / WORDBYTES;
|
|
||||||
// XXX this is running short for -c & -a
|
|
||||||
print!("{:>width$}", "", width = (words_short) * (6 + 2));
|
|
||||||
}
|
|
||||||
print!("\n");
|
print!("\n");
|
||||||
}
|
}
|
||||||
addr += n;
|
addr += n;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue