-
-
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
Fix ls: panicking on dangling symlink with --color=auto -l
#6346
Fix ls: panicking on dangling symlink with --color=auto -l
#6346
Conversation
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.
Thanks for tackling this!
- I'm not yet entirely convinced that the second invocation is actually needed
- If it is needed, what do we do if it fails?
- And of course, please write tests so that we can't regress if we change this in the future :D
- EDIT: Oh, and please fix the typo in the commit message :)
GNU testsuite comparison:
|
--color=auto -l
--color=auto -l
8408f41
to
c8fa0bb
Compare
Changes since last push :
|
GNU testsuite comparison:
|
GNU testsuite comparison:
|
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.
Fixes the problem, and adds a test. Yay!
It looks to me like the test can be simplified by a lot, what did I miss?
a9fe7ab
to
46a9f8c
Compare
46a9f8c
to
a0c01e0
Compare
Changes since last push:
|
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.
Just one last nitpick, then it can be merged :)
I was wondering if i should clean up the commit history a bit more ? Maybe only leave two commits one for the main change and another for the test ? |
GNU testsuite comparison:
|
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.
LGTM 👍
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.
Still looks good ^^
* Fixed unwrap being called on dereferenced dangling symlink * Added test * Switched to regex matching in test * Remove unnecessary mkdir call * Modified documentation of the test and added assertion of the colors * Fixed a typo
* Fixed unwrap being called on dereferenced dangling symlink * Added test * Switched to regex matching in test * Remove unnecessary mkdir call * Modified documentation of the test and added assertion of the colors * Fixed a typo
fixes #6227
The
get_metadata()
function seemed to try to deference to the non existent file. We change it to directly get the metadata of the symlink itself incase the deference fails.