Fix ls: panicking on dangling symlink with --color=auto -l#6346
Merged
BenWiederhake merged 6 commits intouutils:mainfrom May 11, 2024
Merged
Conversation
BenWiederhake
requested changes
May 4, 2024
Collaborator
There was a problem hiding this comment.
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
Contributor
Author
|
Changes since last push :
|
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
BenWiederhake
requested changes
May 7, 2024
Collaborator
BenWiederhake
left a comment
There was a problem hiding this comment.
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
Contributor
Author
|
Changes since last push:
|
Collaborator
BenWiederhake
left a comment
There was a problem hiding this comment.
Just one last nitpick, then it can be merged :)
Contributor
Author
|
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: |
BenWiederhake
approved these changes
May 11, 2024
Collaborator
BenWiederhake
left a comment
There was a problem hiding this comment.
Still looks good ^^
AnirbanHalder654322
added a commit
to AnirbanHalder654322/coreutils
that referenced
this pull request
May 19, 2024
* 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
WaleedKhamees
pushed a commit
to WaleedKhamees/coreutils
that referenced
this pull request
May 20, 2024
* 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.