Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nl: fix zero padding of negative line numbers #5098

Merged

Conversation

cakebaker
Copy link
Contributor

This PR fixes the zero padding of negative line numbers when using -nrz/--number-format=rz. It also moves the logic for formatting line numbers to its own function.

// before change
$ echo "test" | cargo run nl -v-10 --number-format=rz
000-10  test

// after change
$ echo "test" | cargo run nl -v-10 --number-format=rz
-00010  test

This PR probably conflicts with #5091.

@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/rm/rm2 is no longer failing!
Skipping an intermittent issue tests/tail-2/inotify-dir-recreate

@cakebaker cakebaker force-pushed the nl_fix_zero_padding_of_negative_line_numbers branch from 90f63dd to d7d2ad5 Compare July 19, 2023 14:23
@cakebaker
Copy link
Contributor Author

I just realized when fixing the merge conflict that most of #5091 was not necessary :|

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail-2/inotify-dir-recreate

@sylvestre sylvestre merged commit 91e1dde into uutils:main Jul 20, 2023
45 checks passed
@cakebaker cakebaker deleted the nl_fix_zero_padding_of_negative_line_numbers branch July 21, 2023 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants