Skip to content

Conversation

@baodrate
Copy link

  • (( fpath[(i)$f:a:h] )) always evaluates to true. Fix this conditional to use the I subscript flag instead of i
  • Add the e subscript flag to avoid the file paths being interpreted as patterns
  • The ${(k)functions_source[(r)$f:a]} == $f:t conditional only checks if the first function found. Since an autoloaded zsh script can define multiple functions, this fixes the conditional to check all functions defined by that source file.
    • This check might be entirely unnecessary because any autoloaded functions should be in $fpath. And the fpath conditional is more semantically consistent in any case

Before submitting your Pull Request (PR), please check the following:

  • There is no other PR (open or closed) similar to yours. If there is, please first discuss over there.
  • Your new code in each file follows the same style as the existing code in that file.
  • Each commit messages follows the Seven Rules of a Great Commit Message.
  • Each commit message includes Fixes #<bug> or Resolves #<issue> in its body (not subject, that is, the
    first line) for each issue it resolves (if any).
  • You have squashed any redundant or insignificant commits.

* `(( fpath[(i)$f:a:h] ))` always evaluates to true. Fix this
  conditional to use the `I` subscript flag instead of `i`
* Add the `e` subscript flag to avoid the file paths being interpreted
  as patterns
* The `${(k)functions_source[(r)$f:a]} == $f:t` conditional only checks
  if the first function found. Since an autoloaded zsh script can define
  multiple functions, this fixes the conditional to check all functions
  defined by that source file.
  * This check might be entirely unnecessary because any autoloaded functions
    should be in `$fpath`. And the `fpath` conditional is more
    semantically consistent in any case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant