-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
dircolors: trigger an error when used on / #4672
Conversation
src/uu/dircolors/src/dircolors.rs
Outdated
Ok(f) => { | ||
let fin = BufReader::new(f); | ||
result = parse(fin.lines().filter_map(Result::ok), &out_format, files[0]); | ||
result = parse( | ||
fin.lines().filter_map(Result::ok), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an instance of the clippy lint we proposed :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify a bit, this should be map_while
, even though we don't get the infinite loop anymore on a directory, it would still be safer to stop on an error.
result = parse( | ||
fin.lines().filter_map(Result::ok), | ||
&out_format, | ||
&path.to_string_lossy(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could open an issue for date to handle non utf8 paths.
Hm, why do you want to trigger an error in this case? GNU dircolors 9.2 doesn't fail on my machine:
|
Probably the same reason as here: #4572 (comment) |
Thanks, you are right. There is already a new GNU test for it. |
yeah, it is giving an infinite loop. |
Awesome that GNU is fixing this too! |
No description provided.