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.
Description
I had a weird bug on a fresh fish install and I traced it back to this rather weird piece of code. The $opt variable is not set when the if at L29 fails and so just contained random junk from an earlier function call. Moreover, with every subsequent call of of ls it would grow an extra
-F
! I believe the following is the intended meaning of the author.You can look at the blame of linet 53 and 66 to see that this state of things was caused by an old refactor of the ls function.
Fixes issue: if $opt is filled with some junk before calling ls it will result in unexpected behavior
~> set fish_trace on
~> set opt test