SDL_mixer: Fixed test-versioning.sh on macOS

From 11fca9b44f998d82cdaea6942f25486f596bb722 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 25 May 2022 14:59:14 -0700
Subject: [PATCH] Fixed test-versioning.sh on macOS

---
 test-versioning.sh | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/test-versioning.sh b/test-versioning.sh
index 57b6a09a..b7ff6533 100755
--- a/test-versioning.sh
+++ b/test-versioning.sh
@@ -4,6 +4,9 @@
 
 set -eu
 
+# Needed so sed doesn't report illegal byte sequences on macOS
+export LC_CTYPE=C
+
 ref_major=$(sed -ne 's/^#define SDL_MIXER_MAJOR_VERSION  *//p' include/SDL_mixer.h)
 ref_minor=$(sed -ne 's/^#define SDL_MIXER_MINOR_VERSION  *//p' include/SDL_mixer.h)
 ref_micro=$(sed -ne 's/^#define SDL_MIXER_PATCHLEVEL  *//p' include/SDL_mixer.h)
@@ -34,9 +37,9 @@ else
     not_ok "configure.ac $version disagrees with SDL_mixer.h $ref_version"
 fi
 
-major=$(sed -ne 's/^set(MAJOR_VERSION \([0-9]\+\))$/\1/p' CMakeLists.txt)
-minor=$(sed -ne 's/^set(MINOR_VERSION \([0-9]\+\))$/\1/p' CMakeLists.txt)
-micro=$(sed -ne 's/^set(MICRO_VERSION \([0-9]\+\))$/\1/p' CMakeLists.txt)
+major=$(sed -ne 's/^set(MAJOR_VERSION \([0-9]*\))$/\1/p' CMakeLists.txt)
+minor=$(sed -ne 's/^set(MINOR_VERSION \([0-9]*\))$/\1/p' CMakeLists.txt)
+micro=$(sed -ne 's/^set(MICRO_VERSION \([0-9]*\))$/\1/p' CMakeLists.txt)
 version="${major}.${minor}.${micro}"
 
 if [ "$ref_version" = "$version" ]; then
@@ -74,7 +77,7 @@ for rcfile in version.rc VisualC/Version.rc; do
         not_ok "$rcfile PRODUCTVERSION $tuple disagrees with SDL_mixer.h $ref_tuple"
     fi
 
-    tuple=$(sed -Ene 's/^ *VALUE "FileVersion", "([0-9, ]+)\\0"\r?$/\1/p' "$rcfile" | tr -d '\r')
+    tuple=$(sed -Ene 's/^ *VALUE "FileVersion", "([0-9, ]*)\\0"\r?$/\1/p' "$rcfile" | tr -d '\r')
     ref_tuple="${ref_major}, ${ref_minor}, ${ref_micro}, 0"
 
     if [ "$ref_tuple" = "$tuple" ]; then
@@ -83,7 +86,7 @@ for rcfile in version.rc VisualC/Version.rc; do
         not_ok "$rcfile FileVersion $tuple disagrees with SDL_mixer.h $ref_tuple"
     fi
 
-    tuple=$(sed -Ene 's/^ *VALUE "ProductVersion", "([0-9, ]+)\\0"\r?$/\1/p' "$rcfile" | tr -d '\r')
+    tuple=$(sed -Ene 's/^ *VALUE "ProductVersion", "([0-9, ]*)\\0"\r?$/\1/p' "$rcfile" | tr -d '\r')
 
     if [ "$ref_tuple" = "$tuple" ]; then
         ok "$rcfile ProductVersion $tuple"