You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
date: width prefix in %N format specifier ignored if it is a negative number. #12034
uu coreutils' date's width prefix in %N format specifier is ignored if its a negative number. What GNU coreutils does is that when the width prefix in %N is a negative number, it returns an output identical to what the abstract value of the width prefix is.
Maybe we can change width to be an isize and effective_width to be equal to width's abstract value if width < 0?
How to reproduce
$ cargo run date +%-2N
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.12s
Running `target/debug/coreutils date '+%-2N'`
807837678
I would like to work on this, I found the bug in the format_modifiers.rs file under the src/uu/date folder. I have changed the width type to isize allowing negative width inputs, displaying the output as per GNU.
@blixygetir Nice, maintainers here do not assign issues to contributors, you can directly open a pull request with your fix, referring to this issue and wait for a review
Activity
blixygetir commentedon Apr 30, 2026
I would like to work on this, I found the bug in the format_modifiers.rs file under the src/uu/date folder. I have changed the width type to isize allowing negative width inputs, displaying the output as per GNU.
Devel08 commentedon Apr 30, 2026
@blixygetir Nice, maintainers here do not assign issues to contributors, you can directly open a pull request with your fix, referring to this issue and wait for a review