]> git.draconx.ca Git - dxcommon.git/commitdiff
Avoid nonportable ${x%%y} substitutions in DX_LINGUAS.
authorNick Bowler <nbowler@draconx.ca>
Tue, 9 Mar 2021 01:39:09 +0000 (20:39 -0500)
committerNick Bowler <nbowler@draconx.ca>
Tue, 9 Mar 2021 03:35:25 +0000 (22:35 -0500)
Using ${x%%y} substitutions is not portable: in particular it is
not supported by Solaris /bin/sh (or heirloom-sh).  Let's use a
more portable construct instead.

m4/linguas.m4

index c6ad9736ab5bbfbbcb62d1a5310d8170c47410ac..eb6701e2dd92c5696e3fd891b77f44af7ccce2b4 100644 (file)
@@ -32,7 +32,12 @@ if test -f "$srcdir/po/LINGUAS"; then
         # Ensure that if "la_CC"-style code is requested then so is plain "la".
         printf '%s\n' "$arg"
         case $arg in
         # Ensure that if "la_CC"-style code is requested then so is plain "la".
         printf '%s\n' "$arg"
         case $arg in
-        *_*) printf '%s\n' "${arg%%_*}" ;;
+        *_*)
+          save_IFS=$IFS; IFS=_
+          set x $arg
+          IFS=$save_IFS
+          AS_ECHO(["${2}"])
+          ;;
         esac
       done
     } | sort -u >conftest.ena
         esac
       done
     } | sort -u >conftest.ena