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

Bash version detection fails for non-numeric minor versions (e.g. bash 3.05b.*) #522

Closed
flopp opened this issue May 31, 2017 · 1 comment
Labels
bash Related to Bash specific implemetation bug
Milestone

Comments

@flopp
Copy link

flopp commented May 31, 2017

Shell: bash 3.05b.*
Operating system: any
Liquid Prompt version (tag, commit): master, 9c80396

The initial bash version detection fails for BASH_VERSIONs with a minor version containing a non-numeric suffix, e.g. BASH_VERSION="3.05b.0(1)-release".
Such a BASH_VERSION results in a bash error:

-bash: 05b: value too great for base (error token is "05b")

Stripping a non-numeric suffix from bminor in liquidprompt resolves the issue.

@dolmen dolmen added bug bash Related to Bash specific implemetation labels Aug 28, 2018
@Rycieos
Copy link
Collaborator

Rycieos commented Jun 30, 2020

A fix for this is now in master as 0234a58 and in v1.12-beta.1.

Your fix proposed in #523 that was merged into develop was not merged into master. While testing that fix, I discovered $BASH_VERSINFO[@], which offers a more stable way to check versions.

@Rycieos Rycieos added this to the v1.12 milestone Jul 1, 2020
pkkolos pushed a commit to pkkolos/liquidprompt that referenced this issue May 9, 2021
$BASH_VERSINFO has been in Bash since before version 3. This is a safer
and cleaner way to do this check.

The unset variable parameter expansion probably wouldn't ever be needed,
but it doesn't cost anything other than line length.

Fixes liquidprompt#522
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bash Related to Bash specific implemetation bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants