Skip to content
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 array indexing and length handling #1274

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jan 30, 2024

  1. sdkman#1273 Fix array indexing and length handling for sdk ls

    Cf. https://sdkman.slack.com/archives/CJTNQA94M/p1706573532033689?thread_ts=1706516271.626039&cid=CJTNQA94M
    
    - Array indexing is wrong, it starts at 1 (not 0) and ends at the
      highest index, not at array length -1. You have both in C or Java,
      but shell is different.
    - Executed in bash the `${#versions}` is - for whatever reason -
      restricted to four bits. So the maximum value is 15. If the versions
      array is > 15, you have to use `${#versions[@]}` instead (cf.
      https://linuxhandbook.com/array-length-bash/).
    ascheman committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    4a98907 View commit details
    Browse the repository at this point in the history