Skip to content

nl: fix zero padding of negative line numbers#5098

Merged
sylvestre merged 1 commit intouutils:mainfrom
cakebaker:nl_fix_zero_padding_of_negative_line_numbers
Jul 20, 2023
Merged

nl: fix zero padding of negative line numbers#5098
sylvestre merged 1 commit intouutils:mainfrom
cakebaker:nl_fix_zero_padding_of_negative_line_numbers

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
@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.

2 participants