From 432d32c4dcb4cd7226027e815513fddfd1ee4700 Mon Sep 17 00:00:00 2001 From: Frank Snow Date: Sat, 13 Jun 2026 10:01:55 -0400 Subject: [PATCH] Fix unbalanced parens in get_latest_installed_version series regex The regex detecting a 2-part series (e.g. 8.3) had a typo: the character class was written `[0-9)]` instead of `[0-9]+)`. That both drops the `+` quantifier and swallows capture group 1's closing paren, leaving 3 open parens and 2 close parens, so Bash rejects the regex outright: m: line 1506: [[: invalid regular expression `^([0-9)]\.([0-9]+)(-ent)?$': parentheses not balanced The error prints on every path that reaches get_latest_installed_version, including a plain `m 8.3.4` install, and breaks `m .` series resolution. Correct the class to `[0-9]+)` so group 1 captures the major version as the following lines (BASH_REMATCH[1]/[2]) expect. --- bin/m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/m b/bin/m index a0e279e..ca08fe1 100755 --- a/bin/m +++ b/bin/m @@ -1503,7 +1503,7 @@ get_latest_installed_version() { ;; esac - if [[ $version =~ ^([0-9)]\.([0-9]+)(-ent)?$ ]]; then + if [[ $version =~ ^([0-9]+)\.([0-9]+)(-ent)?$ ]]; then local series="${BASH_REMATCH[1]}\.${BASH_REMATCH[2]}" local ent="${BASH_REMATCH[3]}" version=`find ${VERSIONS_DIR} -mindepth 1 -maxdepth 1 -type d \