uucore: leading zeros are ignored in version compare#5013
uucore: leading zeros are ignored in version compare#5013sylvestre merged 3 commits intouutils:mainfrom
Conversation
0b7ffee to
ca31549
Compare
|
GNU testsuite comparison: |
|
Have you seen the previous discussion on this? In particular this thread: #4325 |
|
@tertsdiepraam Ah, i totally missed that. thanks for pointing it out. I was using this as a reference for the non-stable sorting. And i guess stable sorting just preserves the relative order in case when the values are equal? |
|
Indeed. I'm not sure how intentional that is on GNU's side. We could start a discussion there too, because it is (in my opinion) a bit strange. |
|
they do specify |
|
Interesting, I hadn't seen that sentence. That makes sense if it's about the last resort comparison. We should do the same then! |
|
GNU testsuite comparison: |
|
@tertsdiepraam should be ready for review |
|
This does not fix the issue for both stable and unstable does it? I would imagine that version_cmp needs to stake a |
|
In my opinion, the comparison function should return And i believe this pr fixes both stable and unstable case |
|
Returning equal does make sense. How does this solve both cases, though? Edit: Let me clarify. |
|
I can't find anything on how If we wanted to provide our own rules, and make |
|
Yeah not really broken, but it would be something we might need to fix. That could just mean that we need to open an issue, but we do need to know. Could you do some testing with |
|
I did some manual testing and looks like GNU's |
d2e7ba2 to
844cbdc
Compare
|
GNU testsuite comparison: |
|
Thanks :) |
should fix
tests/misc/sort-version.sh