Fixed passing -0 to tail. Closes #10191#10209
Conversation
|
GNU testsuite comparison: |
|
Can you please add a test to ensure we don't regress in the future? Thanks. |
|
@cakebaker all done |
Merging this PR will degrade performance by 27.39%
Performance Changes
Comparing Footnotes
|
src/uu/tail/src/tail.rs
Outdated
|
|
||
| use crate::forwards_thru_file; | ||
| use std::io::Cursor; | ||
| use crate::{backwards_thru_file, forwards_thru_file}; |
There was a problem hiding this comment.
Could this be an integration test in test_tail.rs? I think it would be more ideal to make sure the behaviour with that specific command doesn't regress, also would have less boilerplate to set up the test conditions
|
@ChrisDryden Done |
|
GNU testsuite comparison: |
|
My bad, I should have been more in-depth in the first review to learn more about the different approaches. I was thinking it might be better to re-use the parsing logic in parse_num: If you were to add this to the Signum constructor possibly like this: Then you can reuse that same logic in I'm just a bit hesitant on adding that unwrap without any error handling. It would also make the code more consistent since in one place you have Negative(0) and the other you have MinusZero |
|
@ChrisDryden let's do that in a different PR |
No description provided.